diff --git a/composer.json b/composer.json index 8e38980..9bb05eb 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "minimum-stability": "stable", "require": { - "php": ">=7.4", + "php": ">=8.0", "ext-json": "*" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 7f8db22..f359936 100644 --- a/composer.lock +++ b/composer.lock @@ -4,40 +4,37 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "24fd0ee228c7972d4475213d851c5538", + "content-hash": "d0abbebc7c795998010851e6615e6514", "packages": [], "packages-dev": [ { "name": "elasticsearch/elasticsearch", - "version": "v7.10.0", + "version": "v7.17.0", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "f4a5741f1d1966a4d0a3a3f68666e6d81432c343" + "reference": "1890f9d7fde076b5a3ddcf579a802af05b2e781b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/f4a5741f1d1966a4d0a3a3f68666e6d81432c343", - "reference": "f4a5741f1d1966a4d0a3a3f68666e6d81432c343", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/1890f9d7fde076b5a3ddcf579a802af05b2e781b", + "reference": "1890f9d7fde076b5a3ddcf579a802af05b2e781b", "shasum": "" }, "require": { "ext-json": ">=1.3.7", "ezimuel/ringphp": "^1.1.2", - "php": "^7.1", - "psr/log": "~1.0" + "php": "^7.3 || ^8.0", + "psr/log": "^1|^2|^3" }, "require-dev": { - "cpliakas/git-wrapper": "~2.0", - "doctrine/inflector": "^1.3", "ext-yaml": "*", "ext-zip": "*", "mockery/mockery": "^1.2", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5", + "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.4", - "symfony/finder": "~4.0", - "symfony/yaml": "~4.0" + "symfony/finder": "~4.0" }, "suggest": { "ext-curl": "*", @@ -54,7 +51,8 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "Apache-2.0", + "LGPL-2.1-only" ], "authors": [ { @@ -72,9 +70,9 @@ ], "support": { "issues": "https://github.com/elastic/elasticsearch-php/issues", - "source": "https://github.com/elastic/elasticsearch-php/tree/v7.10.0" + "source": "https://github.com/elastic/elasticsearch-php/tree/v7.17.0" }, - "time": "2020-11-11T16:31:00+00:00" + "time": "2022-02-03T13:40:04+00:00" }, { "name": "ezimuel/guzzlestreams", @@ -131,16 +129,16 @@ }, { "name": "ezimuel/ringphp", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/ezimuel/ringphp.git", - "reference": "0b78f89d8e0bb9e380046c31adfa40347e9f663b" + "reference": "92b8161404ab1ad84059ebed41d9f757e897ce74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezimuel/ringphp/zipball/0b78f89d8e0bb9e380046c31adfa40347e9f663b", - "reference": "0b78f89d8e0bb9e380046c31adfa40347e9f663b", + "url": "https://api.github.com/repos/ezimuel/ringphp/zipball/92b8161404ab1ad84059ebed41d9f757e897ce74", + "reference": "92b8161404ab1ad84059ebed41d9f757e897ce74", "shasum": "" }, "require": { @@ -148,9 +146,12 @@ "php": ">=5.4.0", "react/promise": "~2.0" }, + "replace": { + "guzzlehttp/ringphp": "self.version" + }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~9.0" }, "suggest": { "ext-curl": "Guzzle will use specific adapters if cURL is present" @@ -179,36 +180,36 @@ ], "description": "Fork of guzzle/RingPHP (abandoned) to be used with elasticsearch-php", "support": { - "source": "https://github.com/ezimuel/ringphp/tree/1.1.2" + "source": "https://github.com/ezimuel/ringphp/tree/1.2.0" }, - "time": "2020-02-14T23:51:21+00:00" + "time": "2021-11-16T11:51:30+00:00" }, { "name": "psr/log", - "version": "1.1.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -218,7 +219,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -229,38 +230,38 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "react/promise", - "version": "v2.8.0", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "React\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -269,7 +270,23 @@ "authors": [ { "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], "description": "A lightweight implementation of CommonJS Promises/A for PHP", @@ -279,9 +296,19 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.8.0" + "source": "https://github.com/reactphp/promise/tree/v2.9.0" }, - "time": "2020-05-12T15:16:56+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-02-11T10:27:51+00:00" } ], "aliases": [], @@ -290,7 +317,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", + "php": ">=8.0", "ext-json": "*" }, "platform-dev": { @@ -298,5 +325,5 @@ "ext-cassandra": "*", "ext-mysqli": "*" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.2.0" } diff --git a/src/Query/WhereGroup.php b/src/Query/WhereGroup.php index f5c7816..d063c1e 100644 --- a/src/Query/WhereGroup.php +++ b/src/Query/WhereGroup.php @@ -49,14 +49,10 @@ public function __construct(array $conditions = [], int $conjunction = self:: AN /** * Add an element to the group * - * @param WhereGroup|WhereCondition $conditionOrGroup + * @param WhereCondition|WhereGroup $conditionOrGroup */ - public function add($conditionOrGroup) + public function add(WhereCondition|WhereGroup $conditionOrGroup) { - if (!$conditionOrGroup instanceof WhereCondition && !$conditionOrGroup instanceof WhereGroup) { - throw new \InvalidArgumentException('Argument $conditionOrGroup has to be instance of WhereCondition or WhereGroup.'); - } - $this->group[] = $conditionOrGroup; } @@ -75,7 +71,7 @@ public function getAll(): array * * @return WhereGroup|WhereCondition */ - public function current() + public function current(): WhereGroup|WhereCondition { return $this->group[$this->iterator]; } @@ -85,7 +81,7 @@ public function current() * * @return void */ - public function next() + public function next(): void { $this->iterator++; } @@ -115,7 +111,7 @@ public function valid(): bool * * @return void */ - public function rewind() + public function rewind(): void { $this->iterator = 0; }