diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8e657f4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,38 @@ +name: "Test" + +on: + push: + pull_request: + +jobs: + run: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [ '8.0', '8.1' ] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, intl + coverage: xdebug + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Check code style + run: vendor/bin/php-cs-fixer fix --dry-run --show-progress=dots --verbose --diff + - name: Run static analysis + run: vendor/bin/phpstan + - name: Test with phpunit + run: vendor/bin/phpunit --configuration phpunit.xml.dist --coverage-text diff --git a/.gitignore b/.gitignore index d15c5dd..37864f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor/ phpunit.xml /.phpunit.result.cache +/.php-cs-fixer.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..b64930e --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,47 @@ +in(['src', 'tests']) + ->exclude(['vendor']) +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@Symfony' => true, + '@PHP81Migration' => true, + 'blank_line_after_namespace' => true, + 'blank_line_after_opening_tag' => true, + 'blank_line_before_statement' => true, + 'constant_case' => true, + 'increment_style' => false, + 'lowercase_keywords' => true, + 'normalize_index_brace' => true, + 'no_closing_tag' => true, + 'no_extra_blank_lines' => true, + 'no_singleline_whitespace_before_semicolons' => true, + 'no_spaces_after_function_name' => true, + 'no_spaces_around_offset' => true, + 'no_superfluous_phpdoc_tags' => false, + 'no_unused_imports' => true, + 'no_useless_else' => true, + 'no_whitespace_before_comma_in_array' => true, + 'no_whitespace_in_blank_line' => true, + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'phpdoc_add_missing_param_annotation' => true, + 'phpdoc_align' => false, + 'phpdoc_order' => true, + 'phpdoc_separation' => false, + 'phpdoc_summary' => false, + 'phpdoc_to_comment' => false, + 'protected_to_private' => true, + 'single_blank_line_at_eof' => true, + 'single_blank_line_before_namespace' => true, + 'single_line_comment_style' => false, + 'single_line_throw' => false, + 'single_quote' => false, + 'single_trait_insert_per_statement' => true, + 'whitespace_after_comma_in_array' => true, + ]) + ->setFinder($finder); diff --git a/composer.json b/composer.json index a82e035..5bbb30a 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ {"name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com"} ], "require": { + "php": "^8.0", "phpoption/phpoption": "1.*" }, "autoload": { @@ -20,6 +21,13 @@ } }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^1.6", + "friendsofphp/php-cs-fixer": "^3.8" + }, + "scripts": { + "analyse": "vendor/bin/phpstan analyse -c phpstan.neon -vvv --ansi", + "format": "vendor/bin/php-cs-fixer fix --show-progress=dots --verbose --diff", + "test": "vendor/bin/phpunit" } } diff --git a/composer.lock b/composer.lock index c9f0195..5cafa6b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d30905b4553563d030e62d29159e8f2b", + "content-hash": "857bf86d1d594d6022581c60eb49839d", "packages": [ { "name": "phpoption/phpoption", @@ -58,35 +58,36 @@ ], "packages-dev": [ { - "name": "doctrine/instantiator", - "version": "1.4.0", + "name": "composer/pcre", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "url": "https://github.com/composer/pcre.git", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -95,288 +96,353 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "constructor", - "instantiate" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.0.0" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" + "url": "https://github.com/composer", + "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-02-25T20:21:48+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.10.2", + "name": "composer/semver", + "version": "3.3.2", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "url": "https://github.com/composer/semver.git", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "replace": { - "myclabs/deep-copy": "self.version" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] + "Composer\\Semver\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "semantic", + "semver", + "validation", + "versioning" ], "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2022-04-01T19:23:25+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.13.2", + "name": "composer/xdebug-handler", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.0" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" }, - "bin": [ - "bin/php-parse" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, "autoload": { "psr-4": { - "PhpParser\\": "lib/PhpParser" + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "A PHP parser written in PHP", + "description": "Restarts a process without Xdebug.", "keywords": [ - "parser", - "php" + "Xdebug", + "performance" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, - "time": "2021-11-30T19:35:32+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" }, { - "name": "phar-io/manifest", - "version": "2.0.3", + "name": "doctrine/annotations", + "version": "1.13.2", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "url": "https://github.com/doctrine/annotations.git", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" }, + "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "name": "Roman Borschel", + "email": "roman@code-factory.org" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.2" }, - "time": "2021-07-20T11:28:43+00:00" + "time": "2021-08-05T19:00:23+00:00" }, { - "name": "phar-io/version", - "version": "3.1.0", + "name": "doctrine/instantiator", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" } ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" - }, - "time": "2021-02-23T14:00:09+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "doctrine/lexer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/doctrine/lexer.git", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } + "require-dev": { + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" }, + "type": "library", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -385,239 +451,1973 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "annotations", + "docblock", + "lexer", + "parser", + "php" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.3" }, - "time": "2020-06-27T09:03:43+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-02-28T11:07:21+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "name": "friendsofphp/php-cs-fixer", + "version": "v3.8.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", "shasum": "" }, "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "composer/semver": "^3.2", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "php-cs-fixer/diff": "^2.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^1.5", + "mikey179/vfsstream": "^1.6.10", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.5", + "phpunitgoodpractices/traits": "^1.9.1", + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2022-03-18T17:20:59+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.x-dev" + "dev-master": "4.9-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "sebastian/diff v3 backport support for PHP 5.6+", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + }, + "time": "2020-10-14T08:32:19+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + }, + "time": "2022-01-04T19:58:01+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.6.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "6128620b98292e0b69ea6d799871d77163681c8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6128620b98292e0b69ea6d799871d77163681c8e", + "reference": "6128620b98292e0b69ea6d799871d77163681c8e", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.6.3" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2022-04-28T11:27:53+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-05T09:12:13+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "2406855036db1102126125537adb1406f7242fdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", + "reference": "2406855036db1102126125537adb1406f7242fdd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-25T07:07:57+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" }, - "time": "2021-10-19T17:43:47+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.6.0", + "name": "sebastian/global-state", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" }, - "time": "2022-01-04T19:58:01+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.15.0", + "name": "sebastian/lines-of-code", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" + "nikic/php-parser": "^4.6", + "php": ">=7.3" }, "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" }, - "time": "2021-12-08T12:19:24+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "9.2.10", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "phpunit/phpunit": "^9.3" }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -632,20 +2432,14 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { @@ -653,20 +2447,20 @@ "type": "github" } ], - "time": "2021-12-05T09:12:13+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { @@ -678,7 +2472,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -693,19 +2487,14 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { @@ -713,36 +2502,32 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "phpunit/php-invoker", - "version": "3.1.1", + "name": "sebastian/recursion-context", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { "php": ">=7.3" }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -757,18 +2542,22 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" }, "funding": [ { @@ -776,32 +2565,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2020-10-26T13:17:30+00:00" }, { - "name": "phpunit/php-text-template", - "version": "2.0.4", + "name": "sebastian/resource-operations", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -816,18 +2605,14 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" }, "funding": [ { @@ -835,20 +2620,20 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2020-09-28T06:45:17+00:00" }, { - "name": "phpunit/php-timer", - "version": "5.0.3", + "name": "sebastian/type", + "version": "2.3.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { @@ -860,7 +2645,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -879,14 +2664,11 @@ "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, "funding": [ { @@ -894,75 +2676,34 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { - "name": "phpunit/phpunit", - "version": "9.5.11", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2406855036db1102126125537adb1406f7242fdd" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", - "reference": "2406855036db1102126125537adb1406f7242fdd", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.7", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3.4", - "sebastian/version": "^3.0.2" - }, - "require-dev": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "php": ">=7.3" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" - ], - "files": [ - "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -976,1032 +2717,1272 @@ "role": "lead" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2021-12-25T07:07:57+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { - "name": "sebastian/cli-parser", - "version": "1.0.1", + "name": "symfony/console", + "version": "v6.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "url": "https://github.com/symfony/console.git", + "reference": "0d00aa289215353aa8746a31d101f8e60826285c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/symfony/console/zipball/0d00aa289215353aa8746a31d101f8e60826285c", + "reference": "0d00aa289215353aa8746a31d101f8e60826285c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.0.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, + "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/symfony/console/tree/v6.0.8" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2022-04-20T15:01:42+00:00" }, { - "name": "sebastian/code-unit", - "version": "1.0.8", + "name": "symfony/deprecation-contracts", + "version": "v3.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "classmap": [ - "src/" + "files": [ + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "name": "symfony/event-dispatcher", + "version": "v6.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "6472ea2dd415e925b90ca82be64b8bc6157f3934" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6472ea2dd415e925b90ca82be64b8bc6157f3934", + "reference": "6472ea2dd415e925b90ca82be64b8bc6157f3934", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.0.2", + "symfony/event-dispatcher-contracts": "^2|^3" + }, + "conflict": { + "symfony/dependency-injection": "<5.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^5.4|^6.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" }, + "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.3" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { - "name": "sebastian/comparator", - "version": "4.0.6", + "name": "symfony/event-dispatcher-contracts", + "version": "v3.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "php": ">=8.0.2", + "psr/event-dispatcher": "^1" }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "suggest": { + "symfony/event-dispatcher-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", "keywords": [ - "comparator", - "compare", - "equality" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { - "name": "sebastian/complexity", - "version": "2.0.2", + "name": "symfony/filesystem", + "version": "v6.0.7", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "url": "https://github.com/symfony/filesystem.git", + "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", + "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/symfony/filesystem/tree/v6.0.7" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2022-04-01T12:54:51+00:00" }, { - "name": "sebastian/diff", - "version": "4.0.4", + "name": "symfony/finder", + "version": "v6.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "url": "https://github.com/symfony/finder.git", + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/symfony/finder/zipball/af7edab28d17caecd1f40a9219fc646ae751c21f", + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "php": ">=8.0.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/symfony/finder/tree/v6.0.8" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2022-04-15T08:07:58+00:00" }, { - "name": "sebastian/environment", - "version": "5.1.3", + "name": "symfony/options-resolver", + "version": "v6.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/51f7006670febe4cbcbae177cbffe93ff833250d", + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "config", + "configuration", + "options" ], "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + "source": "https://github.com/symfony/options-resolver/tree/v6.0.3" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-09-28T05:52:38+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { - "name": "sebastian/exporter", - "version": "4.0.4", + "name": "symfony/polyfill-ctype", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "php": ">=7.1" }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "export", - "exporter" + "compatibility", + "ctype", + "polyfill", + "portable" ], "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { - "name": "sebastian/global-state", - "version": "5.0.3", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" + "php": ">=7.1" }, "suggest": { - "ext-uopz": "*" + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", "keywords": [ - "global state" + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-06-11T13:31:12+00:00" + "time": "2021-11-23T21:10:46+00:00" }, { - "name": "sebastian/lines-of-code", - "version": "1.0.3", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "4.0.4", + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { - "name": "sebastian/object-reflector", - "version": "2.0.4", + "name": "symfony/polyfill-php80", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { - "name": "sebastian/recursion-context", - "version": "4.0.4", + "name": "symfony/polyfill-php81", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2021-09-13T13:58:11+00:00" }, { - "name": "sebastian/resource-operations", - "version": "3.0.3", + "name": "symfony/process", + "version": "v6.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "url": "https://github.com/symfony/process.git", + "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/symfony/process/zipball/d074154ea8b1443a96391f6e39f9e547b2dd01b9", + "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" + "php": ">=8.0.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/symfony/process/tree/v6.0.8" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2022-04-12T16:11:42+00:00" }, { - "name": "sebastian/type", - "version": "2.3.4", + "name": "symfony/service-contracts", + "version": "v3.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e517458f278c2131ca9f262f8fbaf01410f2c65c", + "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.0.2", + "psr/container": "^2.0" }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-06-15T12:49:02+00:00" + "time": "2022-03-13T20:10:05+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "symfony/stopwatch", + "version": "v6.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "f2c1780607ec6502f2121d9729fd8150a655d337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f2c1780607ec6502f2121d9729fd8150a655d337", + "reference": "f2c1780607ec6502f2121d9729fd8150a655d337", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.0.2", + "symfony/service-contracts": "^1|^2|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/symfony/stopwatch/tree/v6.0.5" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2022-02-21T17:15:17+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.24.0", + "name": "symfony/string", + "version": "v6.0.8", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "url": "https://github.com/symfony/string.git", + "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" }, - "provide": { - "ext-ctype": "*" + "conflict": { + "symfony/translation-contracts": "<2.0" }, - "suggest": { - "ext-ctype": "For best performance" + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Component\\String\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2010,24 +3991,26 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + "source": "https://github.com/symfony/string/tree/v6.0.8" }, "funding": [ { @@ -2043,7 +4026,7 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-04-22T08:18:02+00:00" }, { "name": "theseer/tokenizer", @@ -2159,7 +4142,9 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": "^8.0" + }, "platform-dev": [], "plugin-api-version": "2.1.0" } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..5c22068 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +parameters: + level: 5 #https://phpstan.org/user-guide/rule-levels + paths: + - src + - tests + ignoreErrors: + - '#Unsafe usage of new static\(\)#' \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 178cfa3..6dbb861 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,6 +6,7 @@ convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" + convertDeprecationsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" @@ -16,6 +17,12 @@ + + + src + + + performance diff --git a/src/PhpCollection/AbstractCollection.php b/src/PhpCollection/AbstractCollection.php index f11652b..31837a9 100644 --- a/src/PhpCollection/AbstractCollection.php +++ b/src/PhpCollection/AbstractCollection.php @@ -19,15 +19,16 @@ namespace PhpCollection; use PhpOption\LazyOption; -use PhpOption\Some; use PhpOption\None; +use PhpOption\Option; +use PhpOption\Some; -abstract class AbstractCollection +abstract class AbstractCollection implements \IteratorAggregate { - public function contains($searchedElem) + public function contains(mixed $searchedElement): bool { foreach ($this as $elem) { - if ($elem === $searchedElem) { + if ($elem === $searchedElement) { return true; } } @@ -35,13 +36,13 @@ public function contains($searchedElem) return false; } - public function find($callable) + public function find(\Closure $callable): Option { $self = $this; - return new LazyOption(function() use ($callable, $self) { + return new LazyOption(function () use ($callable, $self) { foreach ($self as $elem) { - if (call_user_func($callable, $elem) === true) { + if (true === call_user_func($callable, $elem)) { return new Some($elem); } } @@ -49,4 +50,4 @@ public function find($callable) return None::create(); }); } -} \ No newline at end of file +} diff --git a/src/PhpCollection/AbstractMap.php b/src/PhpCollection/AbstractMap.php index 0494b77..b8a456a 100644 --- a/src/PhpCollection/AbstractMap.php +++ b/src/PhpCollection/AbstractMap.php @@ -18,8 +18,9 @@ namespace PhpCollection; -use PhpOption\Some; use PhpOption\None; +use PhpOption\Option; +use PhpOption\Some; /** * A simple map implementation which basically wraps an array with an object oriented interface. @@ -28,22 +29,28 @@ */ class AbstractMap extends AbstractCollection implements \IteratorAggregate, MapInterface { - protected $elements; + /** + * @var array + */ + protected array $elements; - public function __construct(array $elements = array()) + /** + * @param array $elements + */ + public function __construct(array $elements = []) { $this->elements = $elements; } - public function set($key, $value) + public function set(mixed $key, mixed $value): void { $this->elements[$key] = $value; } - public function exists($callable) + public function exists(\Closure $callable): bool { foreach ($this as $k => $v) { - if ($callable($k, $v) === true) { + if (true === $callable($k, $v)) { return true; } } @@ -63,14 +70,16 @@ public function setAll(array $kvMap) $this->elements = array_merge($this->elements, $kvMap); } - public function addMap(MapInterface $map) + public function addMap(MapInterface $map): MapInterface { foreach ($map as $k => $v) { $this->elements[$k] = $v; } + + return $this; } - public function get($key) + public function get($key): Some|None { if (isset($this->elements[$key])) { return new Some($this->elements[$key]); @@ -78,15 +87,15 @@ public function get($key) return None::create(); } - - public function all() + + public function all(): array { return $this->elements; } - public function remove($key) + public function remove(mixed $key): mixed { - if ( ! isset($this->elements[$key])) { + if (!isset($this->elements[$key])) { throw new \InvalidArgumentException(sprintf('The map has no key named "%s".', $key)); } @@ -98,10 +107,10 @@ public function remove($key) public function clear() { - $this->elements = array(); + $this->elements = []; } - public function first() + public function first(): Some|None { if (empty($this->elements)) { return None::create(); @@ -109,10 +118,10 @@ public function first() $elem = reset($this->elements); - return new Some(array(key($this->elements), $elem)); + return new Some([key($this->elements), $elem]); } - public function last() + public function last(): Some|None { if (empty($this->elements)) { return None::create(); @@ -120,13 +129,13 @@ public function last() $elem = end($this->elements); - return new Some(array(key($this->elements), $elem)); + return new Some([key($this->elements), $elem]); } - public function contains($elem) + public function contains(mixed $searchedElement): bool { foreach ($this->elements as $existingElem) { - if ($existingElem === $elem) { + if ($existingElem === $searchedElement) { return true; } } @@ -134,12 +143,12 @@ public function contains($elem) return false; } - public function containsKey($key) + public function containsKey(mixed $key): bool { return isset($this->elements[$key]); } - public function isEmpty() + public function isEmpty(): bool { return empty($this->elements); } @@ -147,11 +156,11 @@ public function isEmpty() /** * Returns a new filtered map. * - * @param callable $callable receives the element and must return true (= keep), or false (= remove). + * @param callable $callable receives the element and must return true (= keep), or false (= remove) * - * @return AbstractMap + * @return MapInterface */ - public function filter($callable) + public function filter($callable): MapInterface { return $this->filterInternal($callable, true); } @@ -159,34 +168,16 @@ public function filter($callable) /** * Returns a new filtered map. * - * @param callable $callable receives the element and must return true (= remove), or false (= keep). + * @param callable $callable receives the element and must return true (= remove), or false (= keep) * - * @return AbstractMap + * @return MapInterface */ - public function filterNot($callable) + public function filterNot($callable): MapInterface { return $this->filterInternal($callable, false); } - /** - * @param callable $callable - * @param boolean $booleanKeep - */ - private function filterInternal($callable, $booleanKeep) - { - $newElements = array(); - foreach ($this->elements as $k => $element) { - if ($booleanKeep !== call_user_func($callable, $element)) { - continue; - } - - $newElements[$k] = $element; - } - - return $this->createNew($newElements); - } - - public function foldLeft($initialValue, $callable) + public function foldLeft(mixed $initialValue, \Closure $callable): mixed { $value = $initialValue; foreach ($this->elements as $elem) { @@ -196,7 +187,7 @@ public function foldLeft($initialValue, $callable) return $value; } - public function foldRight($initialValue, $callable) + public function foldRight(mixed $initialValue, \Closure $callable): mixed { $value = $initialValue; foreach (array_reverse($this->elements) as $elem) { @@ -206,13 +197,13 @@ public function foldRight($initialValue, $callable) return $value; } - public function dropWhile($callable) + public function dropWhile(\Closure $callable): MapInterface { - $newElements = array(); + $newElements = []; $stopped = false; foreach ($this->elements as $k => $v) { - if ( ! $stopped) { - if (call_user_func($callable, $k, $v) === true) { + if (!$stopped) { + if (true === call_user_func($callable, $k, $v)) { continue; } @@ -225,7 +216,7 @@ public function dropWhile($callable) return $this->createNew($newElements); } - public function drop($number) + public function drop(int $number): MapInterface { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('The number must be greater than 0, but got %d.', $number)); @@ -234,7 +225,7 @@ public function drop($number) return $this->createNew(array_slice($this->elements, $number, null, true)); } - public function dropRight($number) + public function dropRight($number): MapInterface { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('The number must be greater than 0, but got %d.', $number)); @@ -243,7 +234,7 @@ public function dropRight($number) return $this->createNew(array_slice($this->elements, 0, -1 * $number, true)); } - public function take($number) + public function take(int $number): MapInterface { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('The number must be greater than 0, but got %d.', $number)); @@ -252,11 +243,11 @@ public function take($number) return $this->createNew(array_slice($this->elements, 0, $number, true)); } - public function takeWhile($callable) + public function takeWhile($callable): MapInterface { - $newElements = array(); + $newElements = []; foreach ($this->elements as $k => $v) { - if (call_user_func($callable, $k, $v) !== true) { + if (true !== call_user_func($callable, $k, $v)) { break; } @@ -266,39 +257,57 @@ public function takeWhile($callable) return $this->createNew($newElements); } - public function find($callable) + public function find(\Closure $callable): Option { foreach ($this->elements as $k => $v) { - if (call_user_func($callable, $k, $v) === true) { - return new Some(array($k, $v)); + if (true === call_user_func($callable, $k, $v)) { + return new Some([$k, $v]); } } return None::create(); } - public function keys() + public function keys(): array { return array_keys($this->elements); } - public function values() + public function values(): array { return array_values($this->elements); } - public function count() + public function count(): int { return count($this->elements); } - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->elements ?: []); } - protected function createNew(array $elements) + protected function createNew(array $elements): MapInterface { return new static($elements); } + + /** + * @param callable $callable + * @param bool $booleanKeep + */ + private function filterInternal($callable, $booleanKeep) + { + $newElements = []; + foreach ($this->elements as $k => $element) { + if ($booleanKeep !== call_user_func($callable, $element)) { + continue; + } + + $newElements[$k] = $element; + } + + return $this->createNew($newElements); + } } diff --git a/src/PhpCollection/AbstractSequence.php b/src/PhpCollection/AbstractSequence.php index cf0fae1..654f38a 100644 --- a/src/PhpCollection/AbstractSequence.php +++ b/src/PhpCollection/AbstractSequence.php @@ -18,10 +18,9 @@ namespace PhpCollection; -use PhpOption\Some; -use PhpOption\None; -use PhpOption\Option; use OutOfBoundsException; +use PhpOption\None; +use PhpOption\Some; /** * A sequence with numerically indexed elements. @@ -35,22 +34,24 @@ */ class AbstractSequence extends AbstractCollection implements \IteratorAggregate, SequenceInterface { - protected $elements; + protected array $elements; /** * @param array $elements */ - public function __construct(array $elements = array()) + public function __construct(array $elements = []) { $this->elements = array_values($elements); } - public function addSequence(SequenceInterface $seq) + public function addSequence(SequenceInterface $seq): SequenceInterface { $this->addAll($seq->all()); + + return $this; } - public function indexOf($searchedElement) + public function indexOf(mixed $searchedElement): int { foreach ($this->elements as $i => $element) { if ($searchedElement === $element) { @@ -61,9 +62,9 @@ public function indexOf($searchedElement) return -1; } - public function lastIndexOf($searchedElement) + public function lastIndexOf(mixed $searchedElement): int { - for ($i=count($this->elements)-1; $i>=0; $i--) { + for ($i = count($this->elements) - 1; $i >= 0; $i--) { if ($this->elements[$i] === $searchedElement) { return $i; } @@ -72,12 +73,12 @@ public function lastIndexOf($searchedElement) return -1; } - public function reverse() + public function reverse(): SequenceInterface { return $this->createNew(array_reverse($this->elements)); } - public function isDefinedAt($index) + public function isDefinedAt(int $index): bool { return isset($this->elements[$index]); } @@ -85,18 +86,16 @@ public function isDefinedAt($index) /** * Returns a filtered sequence. * - * @param callable $callable receives the element and must return true (= keep) or false (= remove). - * - * @return AbstractSequence + * @param \Closure $callable receives the element and must return true (= keep) or false (= remove) */ - public function filter($callable) + public function filter(\Closure $callable): AbstractSequence { return $this->filterInternal($callable, true); } - public function map($callable) + public function map(\Closure $callable): AbstractSequence { - $newElements = array(); + $newElements = []; foreach ($this->elements as $i => $element) { $newElements[$i] = $callable($element); } @@ -107,30 +106,14 @@ public function map($callable) /** * Returns a filtered sequence. * - * @param callable $callable receives the element and must return true (= remove) or false (= keep). - * - * @return AbstractSequence + * @param callable $callable receives the element and must return true (= remove) or false (= keep) */ - public function filterNot($callable) + public function filterNot($callable): AbstractSequence { return $this->filterInternal($callable, false); } - private function filterInternal($callable, $booleanKeep) - { - $newElements = array(); - foreach ($this->elements as $element) { - if ($booleanKeep !== call_user_func($callable, $element)) { - continue; - } - - $newElements[] = $element; - } - - return $this->createNew($newElements); - } - - public function foldLeft($initialValue, $callable) + public function foldLeft(mixed $initialValue, \Closure $callable): mixed { $value = $initialValue; foreach ($this->elements as $elem) { @@ -140,7 +123,7 @@ public function foldLeft($initialValue, $callable) return $value; } - public function foldRight($initialValue, $callable) + public function foldRight(mixed $initialValue, \Closure $callable): mixed { $value = $initialValue; foreach (array_reverse($this->elements) as $elem) { @@ -153,14 +136,12 @@ public function foldRight($initialValue, $callable) /** * Finds the first index where the given callable returns true. * - * @param callable $callable - * - * @return integer the index, or -1 if the predicate is not true for any element. + * @return int the index, or -1 if the predicate is not true for any element */ - public function indexWhere($callable) + public function indexWhere(\Closure $callable): int { foreach ($this->elements as $i => $element) { - if (call_user_func($callable, $element) === true) { + if (true === call_user_func($callable, $element)) { return $i; } } @@ -168,10 +149,10 @@ public function indexWhere($callable) return -1; } - public function lastIndexWhere($callable) + public function lastIndexWhere($callable): int { - for ($i=count($this->elements)-1; $i>=0; $i--) { - if (call_user_func($callable, $this->elements[$i]) === true) { + for ($i = count($this->elements) - 1; $i >= 0; $i--) { + if (true === call_user_func($callable, $this->elements[$i])) { return $i; } } @@ -179,7 +160,7 @@ public function lastIndexWhere($callable) return -1; } - public function last() + public function last(): Some|None { if (empty($this->elements)) { return None::create(); @@ -188,7 +169,7 @@ public function last() return new Some(end($this->elements)); } - public function first() + public function first(): Some|None { if (empty($this->elements)) { return None::create(); @@ -197,7 +178,7 @@ public function first() return new Some(reset($this->elements)); } - public function indices() + public function indices(): array { return array_keys($this->elements); } @@ -205,13 +186,11 @@ public function indices() /** * Returns an element based on its index (0-based). * - * @param integer $index - * - * @return T + * @param int $index */ - public function get($index) + public function get($index): mixed { - if ( ! isset($this->elements[$index])) { + if (!isset($this->elements[$index])) { throw new OutOfBoundsException(sprintf('The index "%s" does not exist in this sequence.', $index)); } @@ -223,13 +202,11 @@ public function get($index) * * @param int $index * - * @return T - * - * @throws \OutOfBoundsException If there is no element at the given index. + * @throws \OutOfBoundsException if there is no element at the given index */ - public function remove($index) + public function remove($index): mixed { - if ( ! isset($this->elements[$index])) { + if (!isset($this->elements[$index])) { throw new OutOfBoundsException(sprintf('The index "%d" is not in the interval [0, %d).', $index, count($this->elements))); } @@ -242,30 +219,27 @@ public function remove($index) /** * Updates the element at the given index (0-based). - * - * @param integer $index - * @param T $value */ - public function update($index, $value) + public function update(int $index, mixed $value): void { - if ( ! isset($this->elements[$index])) { + if (!isset($this->elements[$index])) { throw new \InvalidArgumentException(sprintf('There is no element at index "%d".', $index)); } $this->elements[$index] = $value; } - public function isEmpty() + public function isEmpty(): bool { return empty($this->elements); } - public function all() + public function all(): array { return $this->elements; } - public function add($newElement) + public function add($newElement): void { $this->elements[] = $newElement; } @@ -277,7 +251,7 @@ public function addAll(array $addedElements) } } - public function take($number) + public function take($number): static { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('$number must be greater than 0, but got %d.', $number)); @@ -289,16 +263,14 @@ public function take($number) /** * Extracts element from the head while the passed callable returns true. * - * @param callable $callable receives elements of this sequence as first argument, and returns true/false. - * - * @return Sequence + * @param callable $callable receives elements of this sequence as first argument, and returns true/false */ - public function takeWhile($callable) + public function takeWhile($callable): static { - $newElements = array(); + $newElements = []; - for ($i=0,$c=count($this->elements); $i<$c; $i++) { - if (call_user_func($callable, $this->elements[$i]) !== true) { + for ($i = 0,$c = count($this->elements); $i < $c; $i++) { + if (true !== call_user_func($callable, $this->elements[$i])) { break; } @@ -308,7 +280,7 @@ public function takeWhile($callable) return $this->createNew($newElements); } - public function drop($number) + public function drop($number): SequenceInterface { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('The number must be greater than 0, but got %d.', $number)); @@ -317,7 +289,7 @@ public function drop($number) return $this->createNew(array_slice($this->elements, $number)); } - public function dropRight($number) + public function dropRight($number): SequenceInterface { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('The number must be greater than 0, but got %d.', $number)); @@ -326,9 +298,9 @@ public function dropRight($number) return $this->createNew(array_slice($this->elements, 0, -1 * $number)); } - public function dropWhile($callable) + public function dropWhile($callable): SequenceInterface { - for ($i=0,$c=count($this->elements); $i<$c; $i++) { + for ($i = 0,$c = count($this->elements); $i < $c; $i++) { if (true !== call_user_func($callable, $this->elements[$i])) { break; } @@ -337,10 +309,10 @@ public function dropWhile($callable) return $this->createNew(array_slice($this->elements, $i)); } - public function exists($callable) + public function exists(\Closure $callable): bool { foreach ($this as $elem) { - if ($callable($elem) === true) { + if (true === $callable($elem)) { return true; } } @@ -348,18 +320,32 @@ public function exists($callable) return false; } - public function count() + public function count(): int { return count($this->elements); } - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->elements ?: []); } - protected function createNew(array $elements) + protected function createNew(array $elements): static { return new static($elements); } + + private function filterInternal($callable, $booleanKeep): static + { + $newElements = []; + foreach ($this->elements as $element) { + if ($booleanKeep !== call_user_func($callable, $element)) { + continue; + } + + $newElements[] = $element; + } + + return $this->createNew($newElements); + } } diff --git a/src/PhpCollection/CollectionInterface.php b/src/PhpCollection/CollectionInterface.php index f60bd60..6922d65 100644 --- a/src/PhpCollection/CollectionInterface.php +++ b/src/PhpCollection/CollectionInterface.php @@ -28,57 +28,57 @@ interface CollectionInterface extends \Traversable, \Countable /** * Returns whether this collection contains the passed element. * - * @param mixed $elem + * @param mixed $searchedElement * - * @return boolean + * @return bool */ - public function contains($elem); + public function contains(mixed $searchedElement): bool; /** * Returns whether the collection is empty. * - * @return boolean + * @return bool */ - public function isEmpty(); + public function isEmpty(): bool; /** * Returns a filtered collection of the same type. * * Removes all elements for which the provided callable returns false. * - * @param callable $callable receives an element of the collection and must return true (= keep) or false (= remove). + * @param \Closure $callable receives an element of the collection and must return true (= keep) or false (= remove) * * @return CollectionInterface */ - public function filter($callable); + public function filter(\Closure $callable): CollectionInterface; /** * Returns a filtered collection of the same type. * * Removes all elements for which the provided callable returns true. * - * @param callable $callable receives an element of the collection and must return true (= remove) or false (= keep). + * @param callable $callable receives an element of the collection and must return true (= remove) or false (= keep) * * @return CollectionInterface */ - public function filterNot($callable); + public function filterNot($callable): CollectionInterface; /** * Applies the callable to an initial value and each element, going left to right. * * @param mixed $initialValue - * @param callable $callable receives the current value (the first time this equals $initialValue) and the element + * @param \Closure $callable receives the current value (the first time this equals $initialValue) and the element * - * @return mixed the last value returned by $callable, or $initialValue if collection is empty. + * @return mixed the last value returned by $callable, or $initialValue if collection is empty */ - public function foldLeft($initialValue, $callable); + public function foldLeft(mixed $initialValue, \Closure $callable): mixed; /** * Applies the callable to each element, and an initial value, going right to left. * * @param mixed $initialValue - * @param callable $callable receives the element, and the current value (the first time this equals $initialValue). - * @return mixed the last value returned by $callable, or $initialValue if collection is empty. + * @param \Closure $callable receives the element, and the current value (the first time this equals $initialValue) + * @return mixed the last value returned by $callable, or $initialValue if collection is empty */ - public function foldRight($initialValue, $callable); -} \ No newline at end of file + public function foldRight(mixed $initialValue, \Closure $callable): mixed; +} diff --git a/src/PhpCollection/EntityLikeObject.php b/src/PhpCollection/EntityLikeObject.php index d0d6f4b..53f2955 100644 --- a/src/PhpCollection/EntityLikeObject.php +++ b/src/PhpCollection/EntityLikeObject.php @@ -20,4 +20,4 @@ public function equals(ObjectBasics $other) { return $this === $other; } -} \ No newline at end of file +} diff --git a/src/PhpCollection/Map.php b/src/PhpCollection/Map.php index cb56ba4..e9bbad9 100644 --- a/src/PhpCollection/Map.php +++ b/src/PhpCollection/Map.php @@ -24,4 +24,4 @@ public function sortWith($callable) { uksort($this->elements, $callable); } -} \ No newline at end of file +} diff --git a/src/PhpCollection/MapInterface.php b/src/PhpCollection/MapInterface.php index a974134..94c6793 100644 --- a/src/PhpCollection/MapInterface.php +++ b/src/PhpCollection/MapInterface.php @@ -18,7 +18,9 @@ namespace PhpCollection; +use PhpOption\None; use PhpOption\Option; +use PhpOption\Some; /** * Basic map interface. @@ -30,50 +32,50 @@ interface MapInterface extends CollectionInterface /** * Returns the first element in the collection if available. * - * @return Option on array + * @return Some|None on array */ - public function first(); + public function first(): Some|None; /** * Returns the last element in the collection if available. * - * @return Option on array + * @return Some|None on array */ - public function last(); - + public function last(): Some|None; + /** * Returns all elements in this collection. * * @return array */ - public function all(); + public function all(): array; /** * Searches the collection for an element. * - * @param callable $callable receives the element as first argument, and returns true, or false + * @param \Closure $callable receives the element as first argument, and returns true, or false * * @return Option on array */ - public function find($callable); + public function find(\Closure $callable): Option; /** * Returns the value associated with the given key. * * @param mixed $key * - * @return Option on V + * @return Some|None on V */ - public function get($key); + public function get(mixed $key): Some|None; /** * Returns whether this map contains a given key. * * @param mixed $key * - * @return boolean + * @return bool */ - public function containsKey($key); + public function containsKey(mixed $key): bool; /** * Puts a new element in the map. @@ -83,7 +85,7 @@ public function containsKey($key); * * @return void */ - public function set($key, $value); + public function set(mixed $key, mixed $value): void; /** * Removes an element from the map. @@ -92,7 +94,7 @@ public function set($key, $value); * * @return mixed */ - public function remove($key); + public function remove(mixed $key): mixed; /** * Adds all another map to this map, and returns itself. @@ -101,52 +103,52 @@ public function remove($key); * * @return MapInterface */ - public function addMap(MapInterface $map); + public function addMap(MapInterface $map): MapInterface; /** * Returns an array with the keys. * * @return array */ - public function keys(); + public function keys(): array; /** * Returns an array with the values. * * @return array */ - public function values(); + public function values(): array; /** * Returns a new sequence by omitting the given number of elements from the beginning. * * If the passed number is greater than the available number of elements, all will be removed. * - * @param integer $number + * @param int $number * * @return MapInterface */ - public function drop($number); + public function drop(int $number): MapInterface; /** * Returns a new sequence by omitting the given number of elements from the end. * * If the passed number is greater than the available number of elements, all will be removed. * - * @param integer $number + * @param int $number * * @return MapInterface */ - public function dropRight($number); + public function dropRight(int $number): MapInterface; /** * Returns a new sequence by omitting elements from the beginning for as long as the callable returns true. * - * @param callable $callable Receives the element to drop as first argument, and returns true (drop), or false (stop). + * @param \Closure $callable receives the element to drop as first argument, and returns true (drop), or false (stop) * * @return MapInterface */ - public function dropWhile($callable); + public function dropWhile(\Closure $callable): MapInterface; /** * Creates a new collection by taking the given number of elements from the beginning @@ -155,19 +157,19 @@ public function dropWhile($callable); * If the passed number is greater than the available number of elements, then all elements * will be returned as a new collection. * - * @param integer $number + * @param int $number * * @return MapInterface */ - public function take($number); + public function take(int $number): MapInterface; /** * Creates a new collection by taking elements from the current collection * for as long as the callable returns true. * - * @param callable $callable + * @param \Closure $callable * * @return MapInterface */ - public function takeWhile($callable); + public function takeWhile(\Closure $callable): MapInterface; } diff --git a/src/PhpCollection/ObjectBasics.php b/src/PhpCollection/ObjectBasics.php index 222d06c..2b833b0 100644 --- a/src/PhpCollection/ObjectBasics.php +++ b/src/PhpCollection/ObjectBasics.php @@ -23,10 +23,8 @@ interface ObjectBasics * * When implementing this method try to use a simple and fast algorithm that produces reasonably * different results for non-equal objects, and shift the heavy comparison logic to equals(). - * - * @return string|integer */ - public function hash(); + public function hash(): string|int; /** * Whether two objects are equal. @@ -34,7 +32,7 @@ public function hash(); * This can compare by referential equality (===), or in case of value objects like (\DateTime) compare * the individual properties of the objects; it's up to the implementation. * - * @return boolean + * @return bool */ public function equals(ObjectBasics $other); -} \ No newline at end of file +} diff --git a/src/PhpCollection/ObjectBasicsHandler.php b/src/PhpCollection/ObjectBasicsHandler.php index bf4c1e9..381579e 100644 --- a/src/PhpCollection/ObjectBasicsHandler.php +++ b/src/PhpCollection/ObjectBasicsHandler.php @@ -10,15 +10,14 @@ interface ObjectBasicsHandler { /** - * @param object $object This object is guaranteed to be of the type the handler was registered for. - * @return string|integer + * @param object $object this object is guaranteed to be of the type the handler was registered for */ - public function hash($object); + public function hash($object): string|int; /** - * @param object $firstObject This object is guaranteed to be of the type the handler was registered for. - * @param object $secondObject This might be an object of any class. - * @return boolean + * @param object $firstObject this object is guaranteed to be of the type the handler was registered for + * @param object $secondObject this might be an object of any class + * @return bool */ - public function equals($firstObject, $secondObject); -} \ No newline at end of file + public function equals($firstObject, $secondObject): bool; +} diff --git a/src/PhpCollection/ObjectBasicsHandler/DateTimeHandler.php b/src/PhpCollection/ObjectBasicsHandler/DateTimeHandler.php index d2551ad..c19d580 100644 --- a/src/PhpCollection/ObjectBasicsHandler/DateTimeHandler.php +++ b/src/PhpCollection/ObjectBasicsHandler/DateTimeHandler.php @@ -6,24 +6,24 @@ class DateTimeHandler implements ObjectBasicsHandler { - public function hash($object) + public function hash($object): string|int { - if ( ! $object instanceof \DateTime) { + if (!$object instanceof \DateTime) { throw new \LogicException('$object must be an instance of \DateTime.'); } return $object->getTimestamp(); } - public function equals($thisObject, $otherObject) + public function equals($thisObject, $otherObject): bool { - if ( ! $thisObject instanceof \DateTime) { + if (!$thisObject instanceof \DateTime) { throw new \LogicException('$thisObject must be an instance of \DateTime.'); } - if ( ! $otherObject instanceof \DateTime) { + if (!$otherObject instanceof \DateTime) { return false; } return $thisObject->format(\DateTime::ISO8601) === $otherObject->format(\DateTime::ISO8601); } -} \ No newline at end of file +} diff --git a/src/PhpCollection/ObjectBasicsHandler/IdentityHandler.php b/src/PhpCollection/ObjectBasicsHandler/IdentityHandler.php index 2cc49fb..cba9fca 100644 --- a/src/PhpCollection/ObjectBasicsHandler/IdentityHandler.php +++ b/src/PhpCollection/ObjectBasicsHandler/IdentityHandler.php @@ -6,13 +6,13 @@ class IdentityHandler implements ObjectBasicsHandler { - public function hash($object) + public function hash($object): string { return spl_object_hash($object); } - public function equals($a, $b) + public function equals($a, $b): bool { return $a === $b; } -} \ No newline at end of file +} diff --git a/src/PhpCollection/ObjectBasicsHandlerRegistry.php b/src/PhpCollection/ObjectBasicsHandlerRegistry.php index 4c64ffc..bfea432 100644 --- a/src/PhpCollection/ObjectBasicsHandlerRegistry.php +++ b/src/PhpCollection/ObjectBasicsHandlerRegistry.php @@ -1,6 +1,7 @@ 'PhpCollection\\ObjectBasicsHandler\\DateTimeHandler', - ); + private static array $handlers = [ + \DateTime::class => \PhpCollection\ObjectBasicsHandler\DateTimeHandler::class, + ]; private static $defaultObjectHandler; - private static $aliases = array(); + private static array $aliases = []; + + final private function __construct() + { + } /** * Defines an alias. @@ -40,7 +45,7 @@ public static function addAliasFor($handlingClass, $aliasClass) public static function addHandlerFor($handlingClass, $handlerInstanceOrClassName) { - if ( ! $handlerInstanceOrClassName instanceof ObjectBasicsHandler && ! is_string($handlerInstanceOrClassName)) { + if (!$handlerInstanceOrClassName instanceof ObjectBasicsHandler && !is_string($handlerInstanceOrClassName)) { throw new \LogicException('$handler must be an instance of ObjectBasicsHandler, or a string referring to the handlers class.'); } @@ -53,8 +58,8 @@ public static function getHandler($className) $className = self::$aliases[$className]; } - if ( ! isset(self::$handlers[$className])) { - if (self::$defaultObjectHandler === null) { + if (!isset(self::$handlers[$className])) { + if (null === self::$defaultObjectHandler) { self::$defaultObjectHandler = new IdentityHandler(); } @@ -77,6 +82,4 @@ public static function getHandler($className) $className )); } - - private final function __construct() { } -} \ No newline at end of file +} diff --git a/src/PhpCollection/SequenceInterface.php b/src/PhpCollection/SequenceInterface.php index 43e4077..30d39fc 100644 --- a/src/PhpCollection/SequenceInterface.php +++ b/src/PhpCollection/SequenceInterface.php @@ -18,7 +18,8 @@ namespace PhpCollection; -use PhpOption\Option; +use PhpOption\None; +use PhpOption\Some; /** * Interface for mutable sequences. @@ -32,30 +33,30 @@ interface SequenceInterface extends CollectionInterface /** * Returns the first element in the collection if available. * - * @return Option + * @return Some|None */ - public function first(); + public function first(): Some|None; /** * Returns the last element in the collection if available. * - * @return Option + * @return Some|None */ - public function last(); + public function last(): Some|None; /** * Returns all elements in this sequence. * * @return array */ - public function all(); + public function all(): array; /** * Returns a new Sequence with all elements in reverse order. * * @return SequenceInterface */ - public function reverse(); + public function reverse(): SequenceInterface; /** * Adds the elements of another sequence to this sequence. @@ -64,121 +65,121 @@ public function reverse(); * * @return SequenceInterface */ - public function addSequence(SequenceInterface $seq); + public function addSequence(SequenceInterface $seq): SequenceInterface; /** * Returns the index of the passed element. * - * @param mixed $elem + * @param mixed $searchedElement * - * @return integer the index (0-based), or -1 if not found + * @return int the index (0-based), or -1 if not found */ - public function indexOf($elem); + public function indexOf(mixed $searchedElement): int; /** * Returns the last index of the passed element. * - * @param mixed $elem - * @return integer the index (0-based), or -1 if not found + * @param mixed $searchedElement + * @return int the index (0-based), or -1 if not found */ - public function lastIndexOf($elem); + public function lastIndexOf(mixed $searchedElement): int; /** * Returns whether the given index is defined in the sequence. * - * @param integer $index (0-based) - * @return boolean + * @param int $index (0-based) + * @return bool */ - public function isDefinedAt($index); + public function isDefinedAt(int $index): bool; /** * Returns the first index where the given callable returns true. * - * @param callable $callable receives the element as first argument, and returns true, or false + * @param \Closure $callable receives the element as first argument, and returns true, or false * - * @return integer the index (0-based), or -1 if the callable returns false for all elements + * @return int the index (0-based), or -1 if the callable returns false for all elements */ - public function indexWhere($callable); + public function indexWhere(\Closure $callable): int; /** * Returns the last index where the given callable returns true. * - * @param callable $callable receives the element as first argument, and returns true, or false + * @param \Closure $callable receives the element as first argument, and returns true, or false * - * @return integer the index (0-based), or -1 if the callable returns false for all elements + * @return int the index (0-based), or -1 if the callable returns false for all elements */ - public function lastIndexWhere($callable); + public function lastIndexWhere(\Closure $callable): int; /** * Returns all indices of this collection. * - * @return integer[] + * @return int[] */ - public function indices(); + public function indices(): array; /** * Returns the element at the given index. * - * @param integer $index (0-based) + * @param int $index (0-based) * * @return mixed */ - public function get($index); + public function get($index): mixed; /** * Adds an element to the sequence. * - * @param mixed $elem + * @param mixed $newElement * * @return void */ - public function add($elem); + public function add(mixed $newElement): void; /** * Removes the element at the given index, and returns it. * - * @param integer $index + * @param int $index * * @return mixed */ - public function remove($index); + public function remove($index): mixed; /** * Adds all elements to the sequence. * - * @param array $elements + * @param array $addedElements * * @return void */ - public function addAll(array $elements); + public function addAll(array $addedElements); /** * Updates the value at the given index. * - * @param integer $index + * @param int $index * @param mixed $value * * @return void */ - public function update($index, $value); + public function update(int $index, mixed $value): void; /** * Returns a new sequence by omitting the given number of elements from the beginning. * * If the passed number is greater than the available number of elements, all will be removed. * - * @param integer $number + * @param int $number * * @return SequenceInterface */ - public function drop($number); + public function drop($number): SequenceInterface; /** * Returns a new sequence by omitting the given number of elements from the end. * * If the passed number is greater than the available number of elements, all will be removed. * - * @param integer $number + * @param int $number * * @return SequenceInterface */ @@ -187,7 +188,7 @@ public function dropRight($number); /** * Returns a new sequence by omitting elements from the beginning for as long as the callable returns true. * - * @param callable $callable Receives the element to drop as first argument, and returns true (drop), or false (stop). + * @param callable $callable receives the element to drop as first argument, and returns true (drop), or false (stop) * * @return SequenceInterface */ @@ -200,7 +201,7 @@ public function dropWhile($callable); * If the passed number is greater than the available number of elements, then all elements * will be returned as a new collection. * - * @param integer $number + * @param int $number * * @return CollectionInterface */ @@ -220,8 +221,8 @@ public function takeWhile($callable); * Creates a new collection by applying the passed callable to all elements * of the current collection. * - * @param callable $callable + * @param \Closure $callable * @return CollectionInterface */ - public function map($callable); + public function map(\Closure $callable): CollectionInterface; } diff --git a/src/PhpCollection/Set.php b/src/PhpCollection/Set.php index 3d2c063..ca3c29b 100644 --- a/src/PhpCollection/Set.php +++ b/src/PhpCollection/Set.php @@ -17,22 +17,22 @@ */ class Set implements SetInterface { - const ELEM_TYPE_SCALAR = 1; - const ELEM_TYPE_OBJECT = 2; - const ELEM_TYPE_OBJECT_WITH_HANDLER = 3; + public const ELEM_TYPE_SCALAR = 1; + public const ELEM_TYPE_OBJECT = 2; + public const ELEM_TYPE_OBJECT_WITH_HANDLER = 3; private $elementType; - private $elements = array(); - private $elementCount = 0; - private $lookup = array(); + private array $elements = []; + private int $elementCount = 0; + private array $lookup = []; - public function __construct(array $elements = array()) + public function __construct(array $elements = []) { $this->addAll($elements); } - public function first() + public function first(): Some|None { if (empty($this->elements)) { return None::create(); @@ -41,7 +41,7 @@ public function first() return new Some(reset($this->elements)); } - public function last() + public function last(): Some|None { if (empty($this->elements)) { return None::create(); @@ -50,17 +50,19 @@ public function last() return new Some(end($this->elements)); } - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator(array_values($this->elements ?: [])); } - public function addSet(SetInterface $set) + public function addSet(SetInterface $set): SetInterface { $this->addAll($set->all()); + + return $this; } - public function take($number) + public function take($number): SetInterface { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('$number must be greater than 0, but got %d.', $number)); @@ -72,16 +74,14 @@ public function take($number) /** * Extracts element from the head while the passed callable returns true. * - * @param callable $callable receives elements of this Set as first argument, and returns true/false. - * - * @return Set + * @param callable $callable receives elements of this Set as first argument, and returns true/false */ - public function takeWhile($callable) + public function takeWhile($callable): static { - $newElements = array(); + $newElements = []; - for ($i=0,$c=count($this->elements); $i<$c; $i++) { - if (call_user_func($callable, $this->elements[$i]) !== true) { + for ($i = 0,$c = count($this->elements); $i < $c; $i++) { + if (true !== call_user_func($callable, $this->elements[$i])) { break; } @@ -91,7 +91,7 @@ public function takeWhile($callable) return $this->createNew($newElements); } - public function drop($number) + public function drop($number): SetInterface|static { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('The number must be greater than 0, but got %d.', $number)); @@ -100,7 +100,7 @@ public function drop($number) return $this->createNew(array_slice($this->elements, $number)); } - public function dropRight($number) + public function dropRight($number): SetInterface|static { if ($number <= 0) { throw new \InvalidArgumentException(sprintf('The number must be greater than 0, but got %d.', $number)); @@ -109,9 +109,9 @@ public function dropRight($number) return $this->createNew(array_slice($this->elements, 0, -1 * $number)); } - public function dropWhile($callable) + public function dropWhile($callable): static { - for ($i=0,$c=count($this->elements); $i<$c; $i++) { + for ($i = 0,$c = count($this->elements); $i < $c; $i++) { if (true !== call_user_func($callable, $this->elements[$i])) { break; } @@ -120,9 +120,9 @@ public function dropWhile($callable) return $this->createNew(array_slice($this->elements, $i)); } - public function map($callable) + public function map($callable): static { - $newElements = array(); + $newElements = []; foreach ($this->elements as $i => $element) { $newElements[$i] = $callable($element); } @@ -130,27 +130,27 @@ public function map($callable) return $this->createNew($newElements); } - public function reverse() + public function reverse(): static { return $this->createNew(array_reverse($this->elements)); } - public function all() + public function all(): array { return array_values($this->elements); } - public function filterNot($callable) + public function filterNot($callable): static { return $this->filterInternal($callable, false); } - public function filter($callable) + public function filter($callable): static { return $this->filterInternal($callable, true); } - public function foldLeft($initialValue, $callable) + public function foldLeft(mixed $initialValue, \Closure $callable): mixed { $value = $initialValue; foreach ($this->elements as $elem) { @@ -160,7 +160,7 @@ public function foldLeft($initialValue, $callable) return $value; } - public function foldRight($initialValue, $callable) + public function foldRight(mixed $initialValue, \Closure $callable): mixed { $value = $initialValue; foreach (array_reverse($this->elements) as $elem) { @@ -170,35 +170,35 @@ public function foldRight($initialValue, $callable) return $value; } - public function addAll(array $elements) + public function addAll(array $elements): void { foreach ($elements as $elem) { $this->add($elem); } } - public function count() + public function count(): int { return count($this->elements); } - public function contains($elem) + public function contains(mixed $searchedElement): bool { - if ($this->elementType === self::ELEM_TYPE_OBJECT) { - if ($elem instanceof ObjectBasics) { - return $this->containsObject($elem); + if (self::ELEM_TYPE_OBJECT === $this->elementType) { + if ($searchedElement instanceof ObjectBasics) { + return $this->containsObject($searchedElement); } return false; - } elseif ($this->elementType === self::ELEM_TYPE_OBJECT_WITH_HANDLER) { - if (is_object($elem)) { - return $this->containsObjectWithHandler($elem, ObjectBasicsHandlerRegistry::getHandler(get_class($elem))); + } elseif (self::ELEM_TYPE_OBJECT_WITH_HANDLER === $this->elementType) { + if (is_object($searchedElement)) { + return $this->containsObjectWithHandler($searchedElement, ObjectBasicsHandlerRegistry::getHandler($searchedElement::class)); } return false; - } elseif ($this->elementType === self::ELEM_TYPE_SCALAR) { - if (is_scalar($elem)) { - return $this->containsScalar($elem); + } elseif (self::ELEM_TYPE_SCALAR === $this->elementType) { + if (is_scalar($searchedElement)) { + return $this->containsScalar($searchedElement); } return false; @@ -207,43 +207,43 @@ public function contains($elem) return false; } - public function remove($elem) + public function remove(mixed $elem): void { - if ($this->elementType === self::ELEM_TYPE_OBJECT) { + if (self::ELEM_TYPE_OBJECT === $this->elementType) { if ($elem instanceof ObjectBasics) { $this->removeObject($elem); } - } elseif ($this->elementType === self::ELEM_TYPE_OBJECT_WITH_HANDLER) { + } elseif (self::ELEM_TYPE_OBJECT_WITH_HANDLER === $this->elementType) { if (is_object($elem)) { - $this->removeObjectWithHandler($elem, ObjectBasicsHandlerRegistry::getHandler(get_class($elem))); + $this->removeObjectWithHandler($elem, ObjectBasicsHandlerRegistry::getHandler($elem::class)); } - } elseif ($this->elementType === self::ELEM_TYPE_SCALAR) { + } elseif (self::ELEM_TYPE_SCALAR === $this->elementType) { if (is_scalar($elem)) { $this->removeScalar($elem); } } } - public function isEmpty() + public function isEmpty(): bool { return empty($this->elements); } - public function add($elem) + public function add(mixed $elem): void { - if ($this->elementType === null) { + if (null === $this->elementType) { if ($elem instanceof ObjectBasics) { $this->addObject($elem); } elseif (is_scalar($elem)) { $this->addScalar($elem); } else { if (is_object($elem)) { - $this->addObjectWithHandler($elem, ObjectBasicsHandlerRegistry::getHandler(get_class($elem))); + $this->addObjectWithHandler($elem, ObjectBasicsHandlerRegistry::getHandler($elem::class)); } else { throw new \LogicException(sprintf('The type of $elem ("%s") is not supported in sets.', gettype($elem))); } } - } elseif ($this->elementType === self::ELEM_TYPE_OBJECT) { + } elseif (self::ELEM_TYPE_OBJECT === $this->elementType) { if ($elem instanceof ObjectBasics) { $this->addObject($elem); @@ -251,19 +251,19 @@ public function add($elem) } if (is_object($elem)) { - throw new \LogicException(sprintf('This Set already contains object implement ObjectBasics, and cannot be mixed with objects that do not implement this interface like "%s".', get_class($elem))); + throw new \LogicException(sprintf('This Set already contains object implement ObjectBasics, and cannot be mixed with objects that do not implement this interface like "%s".', $elem::class)); } throw new \LogicException(sprintf('This Set already contains objects, and cannot be mixed with elements of type "%s".', gettype($elem))); - } elseif ($this->elementType === self::ELEM_TYPE_OBJECT_WITH_HANDLER) { + } elseif (self::ELEM_TYPE_OBJECT_WITH_HANDLER === $this->elementType) { if (is_object($elem)) { - $this->addObjectWithHandler($elem, ObjectBasicsHandlerRegistry::getHandler(get_class($elem))); + $this->addObjectWithHandler($elem, ObjectBasicsHandlerRegistry::getHandler($elem::class)); return; } throw new \LogicException(sprintf('This Set already contains object with an external handler, and cannot be mixed with elements of type "%s".', gettype($elem))); - } elseif ($this->elementType === self::ELEM_TYPE_SCALAR) { + } elseif (self::ELEM_TYPE_SCALAR === $this->elementType) { if (is_scalar($elem)) { $this->addScalar($elem); @@ -276,14 +276,14 @@ public function add($elem) } } - protected function createNew(array $elements) + protected function createNew(array $elements): static { return new static($elements); } - private function filterInternal($callable, $booleanKeep) + private function filterInternal($callable, $booleanKeep): static { - $newElements = array(); + $newElements = []; foreach ($this->elements as $element) { if ($booleanKeep !== call_user_func($callable, $element)) { continue; @@ -295,9 +295,9 @@ private function filterInternal($callable, $booleanKeep) return $this->createNew($newElements); } - private function containsScalar($elem) + private function containsScalar($elem): bool { - if ( ! isset($this->lookup[$elem])) { + if (!isset($this->lookup[$elem])) { return false; } @@ -310,10 +310,10 @@ private function containsScalar($elem) return false; } - private function containsObjectWithHandler($object, ObjectBasicsHandler $handler) + private function containsObjectWithHandler($object, ObjectBasicsHandler $handler): bool { $hash = $handler->hash($object); - if ( ! isset($this->lookup[$hash])) { + if (!isset($this->lookup[$hash])) { return false; } @@ -326,10 +326,10 @@ private function containsObjectWithHandler($object, ObjectBasicsHandler $handler return false; } - private function containsObject(ObjectBasics $object) + private function containsObject(ObjectBasics $object): bool { $hash = $object->hash(); - if ( ! isset($this->lookup[$hash])) { + if (!isset($this->lookup[$hash])) { return false; } @@ -344,13 +344,14 @@ private function containsObject(ObjectBasics $object) private function removeScalar($elem) { - if ( ! isset($this->lookup[$elem])) { + if (!isset($this->lookup[$elem])) { return; } foreach ($this->lookup[$elem] as $k => $index) { if ($elem === $this->elements[$index]) { $this->removeElement($elem, $k, $index); + break; } } @@ -359,13 +360,14 @@ private function removeScalar($elem) private function removeObjectWithHandler($object, ObjectBasicsHandler $handler) { $hash = $handler->hash($object); - if ( ! isset($this->lookup[$hash])) { + if (!isset($this->lookup[$hash])) { return; } foreach ($this->lookup[$hash] as $k => $index) { if ($handler->equals($object, $this->elements[$index])) { $this->removeElement($hash, $k, $index); + break; } } @@ -374,13 +376,14 @@ private function removeObjectWithHandler($object, ObjectBasicsHandler $handler) private function removeObject(ObjectBasics $object) { $hash = $object->hash(); - if ( ! isset($this->lookup[$hash])) { + if (!isset($this->lookup[$hash])) { return; } foreach ($this->lookup[$hash] as $k => $index) { if ($object->equals($this->elements[$index])) { $this->removeElement($hash, $k, $index); + break; } } diff --git a/src/PhpCollection/SetInterface.php b/src/PhpCollection/SetInterface.php index a2b250d..04588bd 100644 --- a/src/PhpCollection/SetInterface.php +++ b/src/PhpCollection/SetInterface.php @@ -1,6 +1,7 @@ sortFunc = $sortFunc; } - public function add($newElement) + public function add(mixed $newElement): void { $added = false; - $newElements = array(); + $newElements = []; foreach ($this->elements as $element) { // We insert the new element before the first element that is greater than itself. - if ( ! $added && (integer) call_user_func($this->sortFunc, $newElement, $element) < 0) { + if (!$added && (int) call_user_func($this->sortFunc, $newElement, $element) < 0) { $newElements[] = $newElement; $added = true; } @@ -49,7 +49,7 @@ public function add($newElement) $newElements[] = $element; } - if ( ! $added) { + if (!$added) { $newElements[] = $newElement; } $this->elements = $newElements; @@ -59,13 +59,13 @@ public function addAll(array $addedElements) { usort($addedElements, $this->sortFunc); - $newElements = array(); + $newElements = []; foreach ($this->elements as $element) { - if ( ! empty($addedElements)) { + if (!empty($addedElements)) { foreach ($addedElements as $i => $newElement) { // If the currently looked at $newElement is not smaller than $element, then we can also conclude // that all other new elements are also not smaller than $element as we have ordered them before. - if ((integer) call_user_func($this->sortFunc, $newElement, $element) > -1) { + if ((int) call_user_func($this->sortFunc, $newElement, $element) > -1) { break; } @@ -77,7 +77,7 @@ public function addAll(array $addedElements) $newElements[] = $element; } - if ( ! empty($addedElements)) { + if (!empty($addedElements)) { foreach ($addedElements as $newElement) { $newElements[] = $newElement; } @@ -86,8 +86,8 @@ public function addAll(array $addedElements) $this->elements = $newElements; } - protected function createNew(array $elements) + protected function createNew(array $elements): static { return new static($this->sortFunc, $elements); } -} \ No newline at end of file +} diff --git a/tests/PhpCollection/Tests/MapTest.php b/tests/PhpCollection/Tests/MapTest.php index d0f8371..68e2b97 100644 --- a/tests/PhpCollection/Tests/MapTest.php +++ b/tests/PhpCollection/Tests/MapTest.php @@ -7,18 +7,27 @@ class MapTest extends TestCase { - /** @var Map */ - private $map; + private Map $map; - public function testExists() + protected function setUp(): void { - $this->assertFalse($this->map->exists(function($k) { return $k === 0; })); + $this->map = new Map(); + $this->map->setAll([ + 'foo' => 'bar', + 'bar' => 'baz', + 'baz' => 'boo', + ]); + } + + public function testExists(): void + { + $this->assertFalse($this->map->exists(fn ($k) => 0 === $k)); $this->map->set('foo', 'bar'); - $this->assertTrue($this->map->exists(function($k, $v) { return $k === 'foo' && $v === 'bar'; })); + $this->assertTrue($this->map->exists(fn ($k, $v) => 'foo' === $k && 'bar' === $v)); } - public function testSet() + public function testSet(): void { $this->assertTrue($this->map->get('asdf')->isEmpty()); $this->map->set('asdf', 'foo'); @@ -29,156 +38,156 @@ public function testSet() $this->assertEquals('asdf', $this->map->get('foo')->get()); } - public function testSetSetAll() + public function testSetSetAll(): void { - $this->map->setAll(array('foo' => 'asdf', 'bar' => array('foo'))); - $this->assertEquals(array('foo' => 'asdf', 'bar' => array('foo'), 'baz' => 'boo'), iterator_to_array($this->map)); + $this->map->setAll(['foo' => 'asdf', 'bar' => ['foo']]); + $this->assertEquals(['foo' => 'asdf', 'bar' => ['foo'], 'baz' => 'boo'], iterator_to_array($this->map)); } - - public function testAll() + + public function testAll(): void { - $this->map->setAll(array('foo' => 'asdf', 'bar' => array('foo'))); - $this->assertEquals(array('foo' => 'asdf', 'bar' => array('foo'), 'baz' => 'boo'), $this->map->all()); + $this->map->setAll(['foo' => 'asdf', 'bar' => ['foo']]); + $this->assertEquals(['foo' => 'asdf', 'bar' => ['foo'], 'baz' => 'boo'], $this->map->all()); } - public function testAddMap() + public function testAddMap(): void { $map = new Map(); - $map->set('foo', array('bar')); + $map->set('foo', ['bar']); $this->map->addMap($map); - $this->assertEquals(array('foo' => array('bar'), 'bar' => 'baz', 'baz' => 'boo'), iterator_to_array($this->map)); + $this->assertEquals(['foo' => ['bar'], 'bar' => 'baz', 'baz' => 'boo'], iterator_to_array($this->map)); } - public function testRemove() + public function testRemove(): void { $this->assertTrue($this->map->get('foo')->isDefined()); $this->assertEquals('bar', $this->map->remove('foo')); $this->assertFalse($this->map->get('foo')->isDefined()); } - public function testClear() + public function testClear(): void { $this->assertCount(3, $this->map); $this->map->clear(); $this->assertCount(0, $this->map); } - public function testRemoveWithUnknownIndex() + public function testRemoveWithUnknownIndex(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The map has no key named "asdfasdf".'); $this->map->remove('asdfasdf'); } - public function testFirst() + public function testFirst(): void { - $this->assertEquals(array('foo', 'bar'), $this->map->first()->get()); + $this->assertEquals(['foo', 'bar'], $this->map->first()->get()); $this->map->clear(); $this->assertTrue($this->map->first()->isEmpty()); } - public function testLast() + public function testLast(): void { - $this->assertEquals(array('baz', 'boo'), $this->map->last()->get()); + $this->assertEquals(['baz', 'boo'], $this->map->last()->get()); $this->map->clear(); $this->assertTrue($this->map->last()->isEmpty()); } - public function testContains() + public function testContains(): void { $this->assertTrue($this->map->contains('boo')); $this->assertFalse($this->map->contains('asdf')); } - public function testContainsKey() + public function testContainsKey(): void { $this->assertTrue($this->map->containsKey('foo')); $this->assertFalse($this->map->containsKey('boo')); } - public function testIsEmpty() + public function testIsEmpty(): void { $this->assertFalse($this->map->isEmpty()); $this->map->clear(); $this->assertTrue($this->map->isEmpty()); } - public function testFilter() + public function testFilter(): void { - $map = new Map(array('a' => 'b', 'c' => 'd', 'e' => 'f')); - $newMap = $map->filter(function($v) { return $v === 'd'; }); + $map = new Map(['a' => 'b', 'c' => 'd', 'e' => 'f']); + $newMap = $map->filter(fn ($v) => 'd' === $v); $this->assertNotSame($newMap, $map); $this->assertCount(3, $map); $this->assertCount(1, $newMap); - $this->assertEquals(array('c' => 'd'), iterator_to_array($newMap)); + $this->assertEquals(['c' => 'd'], iterator_to_array($newMap)); } - public function testFilterNot() + public function testFilterNot(): void { - $map = new Map(array('a' => 'b', 'c' => 'd', 'e' => 'f')); - $newMap = $map->filterNot(function($v) { return $v === 'd'; }); + $map = new Map(['a' => 'b', 'c' => 'd', 'e' => 'f']); + $newMap = $map->filterNot(fn ($v): bool => 'd' === $v); $this->assertNotSame($newMap, $map); $this->assertCount(3, $map); $this->assertCount(2, $newMap); - $this->assertEquals(array('a' => 'b', 'e' => 'f'), iterator_to_array($newMap)); + $this->assertEquals(['a' => 'b', 'e' => 'f'], iterator_to_array($newMap)); } - public function testFoldLeftRight() + public function testFoldLeftRight(): void { - $map = new Map(array('a' => 'b', 'c' => 'd', 'e' => 'f')); - $rsLeft = $map->foldLeft('', function($a, $b) { return $a.$b; }); - $rsRight = $map->foldRight('', function($a, $b) { return $a.$b; }); + $map = new Map(['a' => 'b', 'c' => 'd', 'e' => 'f']); + $rsLeft = $map->foldLeft('', fn ($a, $b) => $a.$b); + $rsRight = $map->foldRight('', fn ($a, $b) => $a.$b); $this->assertEquals('bdf', $rsLeft); $this->assertEquals('bdf', $rsRight); } - public function testDropWhile() + public function testDropWhile(): void { - $newMap = $this->map->dropWhile(function($k, $v) { return 'foo' === $k || 'baz' === $v; }); - $this->assertEquals(array('baz' => 'boo'), iterator_to_array($newMap)); + $newMap = $this->map->dropWhile(fn ($k, $v) => 'foo' === $k || 'baz' === $v); + $this->assertEquals(['baz' => 'boo'], iterator_to_array($newMap)); $this->assertCount(3, $this->map); } - public function testDrop() + public function testDrop(): void { $newMap = $this->map->drop(2); - $this->assertEquals(array('baz' => 'boo'), iterator_to_array($newMap)); + $this->assertEquals(['baz' => 'boo'], iterator_to_array($newMap)); $this->assertCount(3, $this->map); } - public function testDropWithNegativeNumber() + public function testDropWithNegativeNumber(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The number must be greater than 0, but got -4.'); $this->map->drop(-4); } - public function testDropRight() + public function testDropRight(): void { $newMap = $this->map->dropRight(2); - $this->assertEquals(array('foo' => 'bar'), iterator_to_array($newMap)); + $this->assertEquals(['foo' => 'bar'], iterator_to_array($newMap)); $this->assertCount(3, $this->map); } - public function testDropRightWithNegativeNumber() + public function testDropRightWithNegativeNumber(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The number must be greater than 0, but got -5.'); $this->map->dropRight(-5); } - public function testTake() + public function testTake(): void { $newMap = $this->map->take(1); - $this->assertEquals(array('foo' => 'bar'), iterator_to_array($newMap)); + $this->assertEquals(['foo' => 'bar'], iterator_to_array($newMap)); $this->assertCount(3, $this->map); } - public function testTakeWithNegativeNumber() + public function testTakeWithNegativeNumber(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The number must be greater than 0, but got -5.'); @@ -186,38 +195,28 @@ public function testTakeWithNegativeNumber() $this->map->take(-5); } - public function testTakeWhile() + public function testTakeWhile(): void { - $newMap = $this->map->takeWhile(function($k, $v) { return 'foo' === $k || 'baz' === $v; }); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), iterator_to_array($newMap)); + $newMap = $this->map->takeWhile(fn ($k, $v) => 'foo' === $k || 'baz' === $v); + $this->assertEquals(['foo' => 'bar', 'bar' => 'baz'], iterator_to_array($newMap)); $this->assertCount(3, $this->map); } - public function testFind() + public function testFind(): void { - $foundElem = $this->map->find(function($k, $v) { return 'foo' === $k && 'bar' === $v; }); - $this->assertEquals(array('foo', 'bar'), $foundElem->get()); + $foundElem = $this->map->find(fn ($k, $v) => 'foo' === $k && 'bar' === $v); + $this->assertEquals(['foo', 'bar'], $foundElem->get()); - $this->assertTrue($this->map->find(function() { return false; })->isEmpty()); + $this->assertTrue($this->map->find(fn () => false)->isEmpty()); } - public function testKeys() + public function testKeys(): void { - $this->assertEquals(array('foo', 'bar', 'baz'), $this->map->keys()); + $this->assertEquals(['foo', 'bar', 'baz'], $this->map->keys()); } - public function testValues() + public function testValues(): void { - $this->assertEquals(array('bar', 'baz', 'boo'), $this->map->values()); - } - - protected function setUp(): void - { - $this->map = new Map(); - $this->map->setAll(array( - 'foo' => 'bar', - 'bar' => 'baz', - 'baz' => 'boo', - )); + $this->assertEquals(['bar', 'baz', 'boo'], $this->map->values()); } } diff --git a/tests/PhpCollection/Tests/SequenceTest.php b/tests/PhpCollection/Tests/SequenceTest.php index 4c8b1b8..f33c168 100644 --- a/tests/PhpCollection/Tests/SequenceTest.php +++ b/tests/PhpCollection/Tests/SequenceTest.php @@ -3,24 +3,33 @@ namespace PhpCollection\Tests; use PhpCollection\Sequence; -use OutOfBoundsException; use PHPUnit\Framework\TestCase; use stdClass; class SequenceTest extends TestCase { - /** @var Sequence */ - private $seq; - private $a; - private $b; + private Sequence $seq; + private \stdClass $a; + private \stdClass $b; - public function testGet() + protected function setUp(): void + { + $this->seq = new Sequence(); + $this->seq->addAll([ + 0, + $this->a = new \stdClass(), + $this->b = new \stdClass(), + 0, + ]); + } + + public function testGet(): void { $this->assertSame(0, $this->seq->get(0)); $this->assertSame($this->a, $this->seq->get(1)); } - public function testIndexOf() + public function testIndexOf(): void { $this->assertSame(0, $this->seq->indexOf(0)); $this->assertSame(1, $this->seq->indexOf($this->a)); @@ -28,14 +37,14 @@ public function testIndexOf() $this->assertSame(-1, $this->seq->indexOf(1)); } - public function testReverse() + public function testReverse(): void { - $seq = new Sequence(array(1, 2, 3)); - $this->assertEquals(array(1, 2, 3), $seq->all()); - $this->assertEquals(array(3, 2, 1), $seq->reverse()->all()); + $seq = new Sequence([1, 2, 3]); + $this->assertEquals([1, 2, 3], $seq->all()); + $this->assertEquals([3, 2, 1], $seq->reverse()->all()); } - public function testLastIndexOf() + public function testLastIndexOf(): void { $this->assertSame(3, $this->seq->lastIndexOf(0)); $this->assertSame(1, $this->seq->lastIndexOf($this->a)); @@ -43,10 +52,10 @@ public function testLastIndexOf() $this->assertSame(-1, $this->seq->lastIndexOf(1)); } - public function testFilter() + public function testFilter(): void { - $seq = new Sequence(array(1, 2, 3)); - $newSeq = $seq->filter(function($n) { return $n === 2; }); + $seq = new Sequence([1, 2, 3]); + $newSeq = $seq->filter(fn ($n) => 2 === $n); $this->assertNotSame($newSeq, $seq); $this->assertCount(3, $seq); @@ -54,10 +63,10 @@ public function testFilter() $this->assertSame(2, $newSeq->get(0)); } - public function testFilterNot() + public function testFilterNot(): void { - $seq = new Sequence(array(1, 2, 3)); - $newSeq = $seq->filterNot(function($n) { return $n === 2; }); + $seq = new Sequence([1, 2, 3]); + $newSeq = $seq->filterNot(fn ($n) => 2 === $n); $this->assertNotSame($newSeq, $seq); $this->assertCount(3, $seq); @@ -66,17 +75,17 @@ public function testFilterNot() $this->assertSame(3, $newSeq->get(1)); } - public function testFoldLeftRight() + public function testFoldLeftRight(): void { - $seq = new Sequence(array('a', 'b', 'c')); - $rsLeft = $seq->foldLeft('', function($a, $b) { return $a.$b; }); - $rsRight = $seq->foldRight('', function($a, $b) { return $a.$b; }); + $seq = new Sequence(['a', 'b', 'c']); + $rsLeft = $seq->foldLeft('', fn ($a, $b) => $a.$b); + $rsRight = $seq->foldRight('', fn ($a, $b) => $a.$b); $this->assertEquals('abc', $rsLeft); $this->assertEquals('abc', $rsRight); } - public function testAddSequence() + public function testAddSequence(): void { $seq = new Sequence(); $seq->add(1); @@ -84,47 +93,47 @@ public function testAddSequence() $this->seq->addSequence($seq); - $this->assertSame(array( + $this->assertSame([ 0, $this->a, $this->b, 0, 1, 0, - ), $this->seq->all()); + ], $this->seq->all()); } - public function testIsDefinedAt() + public function testIsDefinedAt(): void { $this->assertTrue($this->seq->isDefinedAt(0)); $this->assertTrue($this->seq->isDefinedAt(1)); - $this->assertFalse($this->seq->isDefinedAt(9999999)); + $this->assertFalse($this->seq->isDefinedAt(9_999_999)); } - public function testIndexWhere() + public function testIndexWhere(): void { - $this->assertSame(-1, $this->seq->indexWhere(function() { return false; })); - $this->assertSame(0, $this->seq->indexWhere(function() { return true; })); + $this->assertSame(-1, $this->seq->indexWhere(fn () => false)); + $this->assertSame(0, $this->seq->indexWhere(fn () => true)); } - public function testLastIndexWhere() + public function testLastIndexWhere(): void { - $this->assertSame(-1, $this->seq->lastIndexWhere(function() { return false; })); - $this->assertSame(3, $this->seq->lastIndexWhere(function() { return true; })); + $this->assertSame(-1, $this->seq->lastIndexWhere(fn () => false)); + $this->assertSame(3, $this->seq->lastIndexWhere(fn () => true)); } - public function testFirst() + public function testFirst(): void { $this->assertSame(0, $this->seq->first()->get()); $this->assertSame(0, $this->seq->last()->get()); } - public function testIndices() + public function testIndices(): void { - $this->assertSame(array(0, 1, 2, 3), $this->seq->indices()); + $this->assertSame([0, 1, 2, 3], $this->seq->indices()); } - public function testContains() + public function testContains(): void { $this->assertTrue($this->seq->contains(0)); $this->assertTrue($this->seq->contains($this->a)); @@ -132,40 +141,40 @@ public function testContains() $this->assertFalse($this->seq->contains(new stdClass())); } - public function testExists() + public function testExists(): void { - $this->assertTrue($this->seq->exists(function($v) { return $v === 0; })); + $this->assertTrue($this->seq->exists(fn ($v) => 0 === $v)); $a = $this->a; - $this->assertTrue($this->seq->exists(function($v) use ($a) { return $v === $a; })); + $this->assertTrue($this->seq->exists(fn ($v) => $v === $a)); - $this->assertFalse($this->seq->exists(function($v) { return $v === 9999; })); - $this->assertFalse($this->seq->exists(function($v) { return $v === new \stdClass; })); + $this->assertFalse($this->seq->exists(fn ($v) => 9999 === $v)); + $this->assertFalse($this->seq->exists(fn ($v) => $v === new \stdClass())); } - public function testFind() + public function testFind(): void { $a = $this->a; - $this->assertSame($this->a, $this->seq->find(function($x) use ($a) { return $a === $x; })->get()); - $this->assertFalse($this->seq->find(function() { return false; })->isDefined()); + $this->assertSame($this->a, $this->seq->find(fn ($x) => $a === $x)->get()); + $this->assertFalse($this->seq->find(fn () => false)->isDefined()); } - public function testIsEmpty() + public function testIsEmpty(): void { $this->assertFalse($this->seq->isEmpty()); $seq = new Sequence(); $this->assertTrue($seq->isEmpty()); } - public function testAdd() + public function testAdd(): void { $this->seq->add(1); - $this->assertSame(array(0, $this->a, $this->b, 0, 1), $this->seq->all()); + $this->assertSame([0, $this->a, $this->b, 0, 1], $this->seq->all()); - $this->seq->sortWith(function($a, $b) { + $this->seq->sortWith(function ($a, $b) { if (is_integer($a)) { - if ( ! is_integer($b)) { + if (!is_integer($b)) { return -1; } @@ -178,38 +187,38 @@ public function testAdd() if ($a === $this->a && $b === $this->b) { return -1; - } else if ($a === $this->b && $b === $this->a) { + } elseif ($a === $this->b && $b === $this->a) { return 1; } return 1; }); - $this->assertSame(array(0, 0, 1, $this->a, $this->b), $this->seq->all()); + $this->assertSame([0, 0, 1, $this->a, $this->b], $this->seq->all()); } - public function testUpdate() + public function testUpdate(): void { $this->assertSame(0, $this->seq->get(0)); $this->seq->update(0, 5); $this->assertSame(5, $this->seq->get(0)); } - public function testUpdateWithNonExistentIndex() + public function testUpdateWithNonExistentIndex(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('There is no element at index "99999".'); $this->seq->update(99999, 0); } - public function testAddAll() + public function testAddAll(): void { - $this->seq->addAll(array(2, 1, 3)); - $this->assertSame(array(0, $this->a, $this->b, 0, 2, 1, 3), $this->seq->all()); + $this->seq->addAll([2, 1, 3]); + $this->assertSame([0, $this->a, $this->b, 0, 2, 1, 3], $this->seq->all()); - $this->seq->sortWith(function($a, $b) { + $this->seq->sortWith(function ($a, $b) { if (is_integer($a)) { - if ( ! is_integer($b)) { + if (!is_integer($b)) { return -1; } @@ -223,112 +232,106 @@ public function testAddAll() return -1; }); - $this->assertSame(array(0, 0, 1, 2, 3, $this->a, $this->b), $this->seq->all()); + $this->assertSame([0, 0, 1, 2, 3, $this->a, $this->b], $this->seq->all()); } - public function testTake() + public function testTake(): void { - $this->assertSame(array(0), $this->seq->take(1)->all()); - $this->assertSame(array(0, $this->a), $this->seq->take(2)->all()); - $this->assertSame(array(0, $this->a, $this->b, 0), $this->seq->take(9999)->all()); + $this->assertSame([0], $this->seq->take(1)->all()); + $this->assertSame([0, $this->a], $this->seq->take(2)->all()); + $this->assertSame([0, $this->a, $this->b, 0], $this->seq->take(9999)->all()); } - public function testTakeWithNegativeNumber() + public function testTakeWithNegativeNumber(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('$number must be greater than 0, but got -5.'); $this->seq->take(-5); } - public function testTakeWhile() + public function testTakeWhile(): void { - $this->assertSame(array(0), $this->seq->takeWhile('is_integer')->all()); + $this->assertSame([0], $this->seq->takeWhile('is_integer')->all()); } - public function testCount() + public function testCount(): void { $this->assertCount(4, $this->seq); } - public function testTraverse() + public function testTraverse(): void { - $this->assertSame(array(0, $this->a, $this->b, 0), iterator_to_array($this->seq)); + $this->assertSame([0, $this->a, $this->b, 0], iterator_to_array($this->seq)); } - public function testDrop() + public function testDrop(): void { - $this->assertSame(array($this->a, $this->b, 0), $this->seq->drop(1)->all()); - $this->assertSame(array($this->b, 0), $this->seq->drop(2)->all()); - $this->assertSame(array(), $this->seq->drop(9999)->all()); + $this->assertSame([$this->a, $this->b, 0], $this->seq->drop(1)->all()); + $this->assertSame([$this->b, 0], $this->seq->drop(2)->all()); + $this->assertSame([], $this->seq->drop(9999)->all()); } - public function testDropWithNegativeIndex() + public function testDropWithNegativeIndex(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The number must be greater than 0, but got -5.'); $this->seq->drop(-5); } - public function testDropRight() + public function testDropRight(): void { - $this->assertSame(array(0, $this->a, $this->b), $this->seq->dropRight(1)->all()); - $this->assertSame(array(0, $this->a), $this->seq->dropRight(2)->all()); - $this->assertSame(array(), $this->seq->dropRight(9999)->all()); + $this->assertSame([0, $this->a, $this->b], $this->seq->dropRight(1)->all()); + $this->assertSame([0, $this->a], $this->seq->dropRight(2)->all()); + $this->assertSame([], $this->seq->dropRight(9999)->all()); } - public function testDropRightWithNegativeIndex() + public function testDropRightWithNegativeIndex(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The number must be greater than 0, but got -5.'); $this->seq->dropRight(-5); } - public function testDropWhile() + public function testDropWhile(): void { - $this->assertSame(array(0, $this->a, $this->b, 0), $this->seq->dropWhile(function() { return false; })->all()); - $this->assertSame(array(), $this->seq->dropWhile(function() { return true; })->all()); + $this->assertSame([0, $this->a, $this->b, 0], $this->seq->dropWhile(fn () => false)->all()); + $this->assertSame([], $this->seq->dropWhile(fn () => true)->all()); } - public function testRemove() + public function testRemove(): void { $this->assertSame(0, $this->seq->remove(0)); $this->assertSame($this->a, $this->seq->remove(0)); $this->assertSame(0, $this->seq->remove(1)); } - public function testRemoveWithInvalidIndex() + public function testRemoveWithInvalidIndex(): void { $this->expectException(\OutOfBoundsException::class); $this->expectExceptionMessage('The index "9999" is not in the interval [0, 4).'); $this->seq->remove(9999); } - public function testMap() + public function testMap(): void { $seq = new Sequence(); $seq->add('a'); $seq->add('b'); $self = $this; - $newSeq = $seq->map(function($elem) use ($self) { - switch ($elem) { - case 'a': - return 'c'; - - case 'b': - return 'd'; - - default: - $self->fail('Unexpected element: ' . var_export($elem, true)); - } + $newSeq = $seq->map(fn ($elem) => match ($elem) { + 'a' => 'c', + 'b' => 'd', + default => $self->fail('Unexpected element: '.var_export($elem, true)), }); - $this->assertInstanceOf('PhpCollection\Sequence', $newSeq); + $this->assertInstanceOf(\PhpCollection\Sequence::class, $newSeq); $this->assertNotSame($newSeq, $seq); - $this->assertEquals(array('c', 'd'), $newSeq->all()); + $this->assertEquals(['c', 'd'], $newSeq->all()); } - public function testIterator() { + public function testIterator(): void + { $seq = new Sequence([1, 2, 3]); $this->assertIsIterable($seq); $i = 1; @@ -338,15 +341,4 @@ public function testIterator() { } $this->assertSame(4, $i); } - - protected function setUp(): void - { - $this->seq = new Sequence(); - $this->seq->addAll(array( - 0, - $this->a = new \stdClass(), - $this->b = new \stdClass(), - 0 - )); - } } diff --git a/tests/PhpCollection/Tests/SetTest.php b/tests/PhpCollection/Tests/SetTest.php index c5dc0b6..07360f6 100644 --- a/tests/PhpCollection/Tests/SetTest.php +++ b/tests/PhpCollection/Tests/SetTest.php @@ -3,16 +3,20 @@ namespace PhpCollection\Tests; use PhpCollection\ObjectBasics; -use PhpCollection\ObjectBasicsHandlerRegistry; use PhpCollection\Set; use PHPUnit\Framework\TestCase; class SetTest extends TestCase { /** @var Set */ - private $set; + private Set $set; - public function testContainsScalar() + protected function setUp(): void + { + $this->set = new Set(); + } + + public function testContainsScalar(): void { $this->set->add('a'); @@ -21,7 +25,7 @@ public function testContainsScalar() $this->assertFalse($this->set->contains(new \DateTime('today'))); } - public function testContainsObjectWithHandler() + public function testContainsObjectWithHandler(): void { $this->set->add(new \DateTime('today')); @@ -31,7 +35,7 @@ public function testContainsObjectWithHandler() $this->assertTrue($this->set->contains(new \DateTime('today'))); } - public function testContainsObject() + public function testContainsObject(): void { $this->set->add(new ObjectThatImplementsBasics('foo')); @@ -42,38 +46,38 @@ public function testContainsObject() $this->assertTrue($this->set->contains(new ObjectThatImplementsBasics('foo'))); } - public function testReverse() + public function testReverse(): void { $this->set->add('a'); $this->set->add('b'); - $this->assertEquals(array('a', 'b'), $this->set->all()); + $this->assertEquals(['a', 'b'], $this->set->all()); $reversedSet = $this->set->reverse(); - $this->assertEquals(array('a', 'b'), $this->set->all()); - $this->assertEquals(array('b', 'a'), $reversedSet->all()); + $this->assertEquals(['a', 'b'], $this->set->all()); + $this->assertEquals(['b', 'a'], $reversedSet->all()); } - public function testMap() + public function testMap(): void { $this->set->add('a'); $this->set->add('b'); - $this->assertEquals(array('a', 'b'), $this->set->all()); + $this->assertEquals(['a', 'b'], $this->set->all()); - $newSet = $this->set->map(function($char) { - if ($char === 'a') { + $newSet = $this->set->map(function ($char) { + if ('a' === $char) { return 'c'; - } elseif ($char === 'b') { + } elseif ('b' === $char) { return 'd'; } return $char; }); - $this->assertEquals(array('a', 'b'), $this->set->all()); - $this->assertEquals(array('c', 'd'), $newSet->all()); + $this->assertEquals(['a', 'b'], $this->set->all()); + $this->assertEquals(['c', 'd'], $newSet->all()); } - public function testRemoveScalar() + public function testRemoveScalar(): void { $this->set->add('a'); $this->assertCount(1, $this->set); @@ -86,7 +90,7 @@ public function testRemoveScalar() $this->assertTrue($this->set->isEmpty()); } - public function testRemoveObjectWithHandler() + public function testRemoveObjectWithHandler(): void { $this->set->add(new \DateTime('today')); $this->assertCount(1, $this->set); @@ -99,7 +103,7 @@ public function testRemoveObjectWithHandler() $this->assertTrue($this->set->isEmpty()); } - public function testRemoveObject() + public function testRemoveObject(): void { $this->set->add(new ObjectThatImplementsBasics('foo')); $this->assertCount(1, $this->set); @@ -112,71 +116,63 @@ public function testRemoveObject() $this->assertTrue($this->set->isEmpty()); } - public function testAddScalar() + public function testAddScalar(): void { $this->set->add('a'); $this->set->add('b'); $this->set->add('a'); - $this->assertEquals(array('a', 'b'), $this->set->all()); + $this->assertEquals(['a', 'b'], $this->set->all()); } - public function testAddObject() + public function testAddObject(): void { $this->set->add(new ObjectThatImplementsBasics('foo')); $this->set->add(new ObjectThatImplementsBasics('bar')); $this->set->add(new ObjectThatImplementsBasics('foo')); $this->assertEquals( - array( + [ new ObjectThatImplementsBasics('foo'), - new ObjectThatImplementsBasics('bar') - ), + new ObjectThatImplementsBasics('bar'), + ], $this->set->all() ); } - public function testAddObjectWithHandler() + public function testAddObjectWithHandler(): void { $this->set->add((new \DateTime('today'))->setTimezone(new \DateTimeZone('UTC'))); $this->set->add((new \DateTime('today'))->setTimezone(new \DateTimeZone('UTC'))); $this->set->add((new \DateTime('today'))->setTimezone(new \DateTimeZone('US/Pacific'))); $this->assertEquals( - array( + [ (new \DateTime('today'))->setTimezone(new \DateTimeZone('UTC')), (new \DateTime('today'))->setTimezone(new \DateTimeZone('US/Pacific')), - ), + ], $this->set->all() ); } - - protected function setUp(): void - { - $this->set = new Set(); - } } class ObjectThatImplementsBasics implements ObjectBasics { - private $value; - - public function __construct($value) + public function __construct(private mixed $value) { - $this->value = $value; } - public function hash() + public function hash(): string { return 'foo'; // This is not recommended in the real-world. } - public function equals(ObjectBasics $other) + public function equals(ObjectBasics $other): bool { if ($this === $other) { return true; } - if ( ! $other instanceof ObjectThatImplementsBasics) { + if (!$other instanceof ObjectThatImplementsBasics) { return false; } diff --git a/tests/PhpCollection/Tests/SortedSequenceTest.php b/tests/PhpCollection/Tests/SortedSequenceTest.php index c75f56f..fdc3412 100644 --- a/tests/PhpCollection/Tests/SortedSequenceTest.php +++ b/tests/PhpCollection/Tests/SortedSequenceTest.php @@ -7,40 +7,15 @@ class SortedSequenceTest extends TestCase { - private $seq; - private $a; - private $b; - - public function testAdd() - { - $this->seq->add(1); - $this->assertSame(array(0, 0, 1, $this->a, $this->b), $this->seq->all()); - - $this->seq->add(2); - $this->assertSame(array(0, 0, 1, 2, $this->a, $this->b), $this->seq->all()); - } - - public function testAddAll() - { - $this->seq->addAll(array(2, 1, 3)); - $this->assertSame(array(0, 0, 1, 2, 3, $this->a, $this->b), $this->seq->all()); - - $this->seq->addAll(array(2, 3, 1, 2)); - $this->assertSame(array(0, 0, 1, 1, 2, 2, 2, 3, 3, $this->a, $this->b), $this->seq->all()); - } - - public function testTake() - { - $seq = $this->seq->take(2); - $this->assertInstanceOf('PhpCollection\SortedSequence', $seq); - $this->assertSame(array(0, 0), $seq->all()); - } + private SortedSequence $seq; + private \stdClass $a; + private \stdClass $b; protected function setUp(): void { - $this->seq = new SortedSequence(function($a, $b) { + $this->seq = new SortedSequence(function ($a, $b) { if (is_integer($a)) { - if ( ! is_integer($b)) { + if (!is_integer($b)) { return -1; } @@ -53,11 +28,36 @@ protected function setUp(): void return -1; }); - $this->seq->addAll(array( + $this->seq->addAll([ 0, - $this->a = new \stdClass, - $this->b = new \stdClass, + $this->a = new \stdClass(), + $this->b = new \stdClass(), 0, - )); + ]); + } + + public function testAdd(): void + { + $this->seq->add(1); + $this->assertSame([0, 0, 1, $this->a, $this->b], $this->seq->all()); + + $this->seq->add(2); + $this->assertSame([0, 0, 1, 2, $this->a, $this->b], $this->seq->all()); + } + + public function testAddAll(): void + { + $this->seq->addAll([2, 1, 3]); + $this->assertSame([0, 0, 1, 2, 3, $this->a, $this->b], $this->seq->all()); + + $this->seq->addAll([2, 3, 1, 2]); + $this->assertSame([0, 0, 1, 1, 2, 2, 2, 3, 3, $this->a, $this->b], $this->seq->all()); + } + + public function testTake(): void + { + $seq = $this->seq->take(2); + $this->assertInstanceOf(\PhpCollection\SortedSequence::class, $seq); + $this->assertSame([0, 0], $seq->all()); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 37d8f3f..4adf1e6 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,8 +1,8 @@