diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a7e6fa4..4a6f968 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ before_script: apt-get update -yqq && apt-get upgrade -yqq && apt-get install -yqq git libzip-dev unzip zip libpcre3-dev && docker-php-ext-install zip && pecl install xdebug && docker-php-ext-enable xdebug fi - > - if [ "$CI_JOB_NAME" == "test:7.4" ] || [ "$CI_JOB_NAME" == "test:8.0" ]; then + if [ "$CI_JOB_NAME" == "test:8.1" ]; then pecl install ds && docker-php-ext-enable ds fi - > @@ -23,36 +23,20 @@ before_script: curl -sS https://getcomposer.org/installer | php php composer.phar install fi -test:7.4: +test:8.1: only: - branches tags: - default - image: php:7.4 + image: php:8.1 script: - vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never -test:7.4-without-ext-ds: +test:8.1-without-ext-ds: only: - branches tags: - default - image: php:7.4 - script: - - vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never -test:8.0: - only: - - branches - tags: - - default - image: php:8.0 - script: - - vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never -test:8.0-without-ext-ds: - only: - - branches - tags: - - default - image: php:8.0 + image: php:8.1 script: - vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never stages: diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..19e62e8 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,77 @@ +setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + '@PHP80Migration' => true, + '@PHP80Migration:risky' => true, + '@PHP81Migration' => true, + 'header_comment' => ['header' => $header], + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'no_mixed_echo_print' => ['use' => 'print'], + 'strict_param' => true, + 'strict_comparison' => true, + 'single_import_per_statement' => false, + 'phpdoc_order' => true, + 'array_syntax' => ['syntax' => 'short'], + 'phpdoc_add_missing_param_annotation' => true, + 'psr_autoloading' => true, + 'phpdoc_var_without_name' => false, + 'no_unused_imports' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'no_extra_blank_lines' => [ + 'tokens' => [ + 'break', + 'continue', + 'extra', + 'return', + 'throw', + 'parenthesis_brace_block', + 'square_brace_block', + 'curly_brace_block', + ], + ], + ])->setFinder( + (new \PhpCsFixer\Finder()) + ->ignoreDotFiles(true) + ->ignoreVCS(true) + ->name('*.php') + ->in([ + 'src', + 'tests', + __DIR__, + ]) + ); diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 4bf445f..0000000 --- a/.php_cs.dist +++ /dev/null @@ -1,58 +0,0 @@ -setRiskyAllowed(true) - ->setRules( - [ - '@PSR2' => true, - '@PHP70Migration' => true, - '@PHP70Migration:risky' => true, - '@PHP71Migration' => true, - '@PHP71Migration:risky' => true, - '@PHP73Migration' => true, - '@PHP74Migration' => true, - '@PHP74Migration:risky' => true, - '@PHP80Migration' => true, - '@PHP80Migration:risky' => true, - 'header_comment' => ['header' => $header], - 'ordered_class_elements' => true, - 'ordered_imports' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'strict_param' => true, - 'strict_comparison' => true, - 'single_import_per_statement' => false, - 'phpdoc_order' => true, - 'array_syntax' => ['syntax' => 'short'], - 'phpdoc_add_missing_param_annotation' => true, - 'psr4' => true, - 'phpdoc_var_without_name' => false, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_extra_consecutive_blank_lines' => [ - 'break', - 'continue', - 'extra', - 'return', - 'throw', - 'parenthesis_brace_block', - 'square_brace_block', - 'curly_brace_block', - ], - ] - )->setFinder( - PhpCsFixer\Finder::create() - ->ignoreDotFiles(true) - ->ignoreVCS(true) - ->name('*.php') - ->in([ - 'src', - 'tests', - ]) - ); \ No newline at end of file diff --git a/composer.json b/composer.json index c9f5c2b..ba8f7ff 100644 --- a/composer.json +++ b/composer.json @@ -1,14 +1,13 @@ { - "name": "olivebbs/map", + "name": "olive/map", "description": "Generic map for PHP", "type": "library", "require": { - "php": ">=7.4", - "php-ds/php-ds": "^1.3", - "symfony/polyfill-php80": "^1.22" + "php": ">=8.1", + "php-ds/php-ds": "^1.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", + "friendsofphp/php-cs-fixer": "^3.8", "phpunit/phpunit": "^9.5" }, "license": "MPL-2.0", @@ -19,7 +18,7 @@ } ], "suggest": { - "ext-ds": "ext-ds" + "ext-ds": "To use the Data structure extension instead of polyfill." }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 82b993a..d699f75 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": "a566fdaf6ff9f571687f26e3dc7a8a62", + "content-hash": "7280268dab0ec0a2dcc7cd9f97171217", "packages": [ { "name": "php-ds/php-ds", @@ -60,118 +60,35 @@ "source": "https://github.com/php-ds/polyfill/tree/v1.4.1" }, "time": "2022-03-09T20:39:30+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "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": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" - }, - "funding": [ - { - "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": "2022-03-04T08:16:47+00:00" } ], "packages-dev": [ { "name": "composer/pcre", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" + "symfony/phpunit-bridge": "^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -199,7 +116,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" + "source": "https://github.com/composer/pcre/tree/3.0.0" }, "funding": [ { @@ -215,7 +132,7 @@ "type": "tidelift" } ], - "time": "2022-01-21T20:24:37+00:00" + "time": "2022-02-25T20:21:48+00:00" }, { "name": "composer/semver", @@ -300,27 +217,27 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -346,7 +263,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -362,7 +279,7 @@ "type": "tidelift" } ], - "time": "2022-02-24T20:20:32+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "doctrine/annotations", @@ -584,85 +501,65 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.3", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", "shasum": "" }, "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", + "composer/semver": "^3.2", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + "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": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", + "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-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + "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.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + "ext-mbstring": "For handling non-UTF8 characters." }, "bin": [ "php-cs-fixer" ], "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -681,7 +578,7 @@ "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/v2.19.3" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" }, "funding": [ { @@ -689,7 +586,7 @@ "type": "github" } ], - "time": "2021-11-15T17:17:55+00:00" + "time": "2022-03-18T17:20:59+00:00" }, { "name": "myclabs/deep-copy", @@ -919,16 +816,16 @@ }, { "name": "php-cs-fixer/diff", - "version": "v1.3.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", "shasum": "" }, "require": { @@ -956,21 +853,18 @@ { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", + "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/v1.3.1" + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" }, - "time": "2020-10-14T08:39:05+00:00" + "time": "2020-10-14T08:32:19+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1622,20 +1516,20 @@ }, { "name": "psr/cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { @@ -1655,7 +1549,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for caching libraries", @@ -1665,28 +1559,33 @@ "psr-6" ], "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "source": "https://github.com/php-fig/cache/tree/3.0.0" }, - "time": "2016-08-06T20:24:11+00:00" + "time": "2021-02-03T23:26:27+00:00" }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "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/" @@ -1713,9 +1612,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", @@ -1769,30 +1668,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1813,9 +1712,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "sebastian/cli-parser", @@ -2783,46 +2682,42 @@ }, { "name": "symfony/console", - "version": "v5.4.8", + "version": "v6.0.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b" + "reference": "0d00aa289215353aa8746a31d101f8e60826285c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", - "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", + "url": "https://api.github.com/repos/symfony/console/zipball/0d00aa289215353aa8746a31d101f8e60826285c", + "reference": "0d00aa289215353aa8746a31d101f8e60826285c", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/string": "^5.4|^6.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "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" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "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" }, "suggest": { "psr/log": "For using the console logger", @@ -2862,7 +2757,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.8" + "source": "https://github.com/symfony/console/tree/v6.0.8" }, "funding": [ { @@ -2878,29 +2773,29 @@ "type": "tidelift" } ], - "time": "2022-04-12T16:02:29+00:00" + "time": "2022-04-20T15:01:42+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.1", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -2929,7 +2824,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.1" }, "funding": [ { @@ -2945,44 +2840,42 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.3", + "version": "v6.0.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" + "reference": "6472ea2dd415e925b90ca82be64b8bc6157f3934" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6472ea2dd415e925b90ca82be64b8bc6157f3934", + "reference": "6472ea2dd415e925b90ca82be64b8bc6157f3934", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2", + "symfony/event-dispatcher-contracts": "^2|^3" }, "conflict": { - "symfony/dependency-injection": "<4.4" + "symfony/dependency-injection": "<5.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", + "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": "^4.4|^5.0|^6.0" + "symfony/stopwatch": "^5.4|^6.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3014,7 +2907,7 @@ "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": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.3" }, "funding": [ { @@ -3030,24 +2923,24 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.1", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "psr/event-dispatcher": "^1" }, "suggest": { @@ -3056,7 +2949,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -3093,7 +2986,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.1" }, "funding": [ { @@ -3109,27 +3002,26 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.7", + "version": "v6.0.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" + "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", - "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", + "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "~1.8" }, "type": "library", "autoload": { @@ -3157,7 +3049,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.7" + "source": "https://github.com/symfony/filesystem/tree/v6.0.7" }, "funding": [ { @@ -3173,26 +3065,24 @@ "type": "tidelift" } ], - "time": "2022-04-01T12:33:59+00:00" + "time": "2022-04-01T12:54:51+00:00" }, { "name": "symfony/finder", - "version": "v5.4.8", + "version": "v6.0.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", + "url": "https://api.github.com/repos/symfony/finder/zipball/af7edab28d17caecd1f40a9219fc646ae751c21f", + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -3220,7 +3110,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.8" + "source": "https://github.com/symfony/finder/tree/v6.0.8" }, "funding": [ { @@ -3236,27 +3126,25 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:07:45+00:00" + "time": "2022-04-15T08:07:58+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.3", + "version": "v6.0.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", - "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/51f7006670febe4cbcbae177cbffe93ff833250d", + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" }, "type": "library", "autoload": { @@ -3289,7 +3177,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" + "source": "https://github.com/symfony/options-resolver/tree/v6.0.3" }, "funding": [ { @@ -3305,7 +3193,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3638,85 +3526,17 @@ "time": "2021-11-30T18:21:41+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "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-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php72", + "name": "symfony/polyfill-php80", "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -3737,14 +3557,21 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -3754,7 +3581,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -3763,7 +3590,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -3779,20 +3606,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:17:38+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { - "name": "symfony/polyfill-php73", + "name": "symfony/polyfill-php81", "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", "shasum": "" }, "require": { @@ -3813,7 +3640,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Polyfill\\Php81\\": "" }, "classmap": [ "Resources/stubs" @@ -3833,7 +3660,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -3842,7 +3669,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" }, "funding": [ { @@ -3858,25 +3685,24 @@ "type": "tidelift" } ], - "time": "2021-06-05T21:20:04+00:00" + "time": "2021-09-13T13:58:11+00:00" }, { "name": "symfony/process", - "version": "v5.4.8", + "version": "v6.0.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" + "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "url": "https://api.github.com/repos/symfony/process/zipball/d074154ea8b1443a96391f6e39f9e547b2dd01b9", + "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -3904,7 +3730,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.8" + "source": "https://github.com/symfony/process/tree/v6.0.8" }, "funding": [ { @@ -3920,26 +3746,25 @@ "type": "tidelift" } ], - "time": "2022-04-08T05:07:18+00:00" + "time": "2022-04-12T16:11:42+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.1", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e517458f278c2131ca9f262f8fbaf01410f2c65c", + "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.0.2", + "psr/container": "^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -3950,7 +3775,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -3987,7 +3812,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.1" }, "funding": [ { @@ -4003,24 +3828,24 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:07:29+00:00" + "time": "2022-03-13T20:10:05+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.5", + "version": "v6.0.5", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" + "reference": "f2c1780607ec6502f2121d9729fd8150a655d337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", - "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f2c1780607ec6502f2121d9729fd8150a655d337", + "reference": "f2c1780607ec6502f2121d9729fd8150a655d337", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/service-contracts": "^1|^2|^3" }, "type": "library", @@ -4049,7 +3874,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" + "source": "https://github.com/symfony/stopwatch/tree/v6.0.5" }, "funding": [ { @@ -4065,38 +3890,37 @@ "type": "tidelift" } ], - "time": "2022-02-18T16:06:09+00:00" + "time": "2022-02-21T17:15:17+00:00" }, { "name": "symfony/string", - "version": "v5.4.8", + "version": "v6.0.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8" + "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", - "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", + "url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", "shasum": "" }, "require": { - "php": ">=7.2.5", + "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", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "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", "autoload": { @@ -4135,7 +3959,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.8" + "source": "https://github.com/symfony/string/tree/v6.0.8" }, "funding": [ { @@ -4151,7 +3975,7 @@ "type": "tidelift" } ], - "time": "2022-04-19T10:40:37+00:00" + "time": "2022-04-22T08:18:02+00:00" }, { "name": "theseer/tokenizer", @@ -4268,7 +4092,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4" + "php": ">=8.1" }, "platform-dev": [], "plugin-api-version": "2.3.0" diff --git a/src/Olivebbs/Map/CharMap.php b/src/Olivebbs/Map/CharMap.php index 5ddbb39..a6f961c 100644 --- a/src/Olivebbs/Map/CharMap.php +++ b/src/Olivebbs/Map/CharMap.php @@ -34,14 +34,15 @@ class CharMap extends GenericMap { public function __construct(array $initialValues = []) { - parent::__construct(self::CHAR, self::CHAR); + parent::__construct(keyType: self::CHAR, valueType: self::CHAR); - $this->map->putAll($initialValues); + $this->map->putAll(values: $initialValues); } - public static function fromString(string $string): CharMap + public static function fromString(string $string): static { - $values = str_split($string); - return new self(array_combine($values, $values)); + $values = str_split(string: $string); + + return new static(initialValues: array_combine(keys: $values, values: $values)); } } diff --git a/src/Olivebbs/Map/GenericMap.php b/src/Olivebbs/Map/GenericMap.php index a438344..a33a257 100644 --- a/src/Olivebbs/Map/GenericMap.php +++ b/src/Olivebbs/Map/GenericMap.php @@ -28,15 +28,19 @@ namespace Olivebbs\Map; use ArrayAccess; +use function class_exists; use Countable; use Ds\Map; +use function enum_exists; +use function in_array; use function is_array; use function is_callable; use function is_int; use function is_object; use function is_string; +use function mb_strlen; use Olivebbs\Map\Exception\InvalidArgumentException; - +use function sprintf; use function strtolower; use TypeError; use ValueError; @@ -50,24 +54,23 @@ class GenericMap implements ArrayAccess, Countable public const INTEGER = 'integer'; public const STRING = 'string'; public const CHAR = 'char'; + public const ENUM = 'enum'; public const ANY = 'any'; protected Map $map; - protected string $keyType; - protected string $valueType; - public function __construct(string $keyType = self::ANY, string $valueType = self::ANY) + public function __construct(protected string $keyType = self::ANY, protected string $valueType = self::ANY) { - $this->keyType = strtolower($keyType); + $this->keyType = strtolower(string: $keyType); - $this->valueType = class_exists($valueType) ? $valueType : strtolower($valueType); + $this->valueType = class_exists(class: $valueType) ? $valueType : strtolower(string: $valueType); - if (!$this->isValidKeyType($this->keyType)) { - throw new InvalidArgumentException(sprintf('Invalid key type (%s)', $this->keyType)); + if (!$this->isValidKeyType(type: $this->keyType)) { + throw new InvalidArgumentException(message: sprintf('Invalid key type (%s)', $this->keyType)); } - if (!$this->isValidValueType($this->valueType)) { - throw new InvalidArgumentException(sprintf('Invalid value type (%s)', $this->valueType)); + if (!$this->isValidValueType(type: $this->valueType)) { + throw new InvalidArgumentException(message: sprintf('Invalid value type (%s)', $this->valueType)); } $this->map = new Map(); @@ -86,71 +89,45 @@ class GenericMap implements ArrayAccess, Countable /** * @inheritDoc */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { - if (is_array($offset) || is_object($offset)) { - throw new InvalidArgumentException('Map keys cannot be objects or arrays'); - } + $this->checkTypes(offset: $offset); - if (!$this->checkType($this->keyType, $offset)) { - throw new TypeError(sprintf('Key should be of value %s.', $this->keyType)); - } - - return $this->map->offsetExists($offset); + return $this->map->offsetExists(offset: $offset); } /** * @inheritDoc */ - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { - if (is_array($offset) || is_object($offset)) { - throw new InvalidArgumentException('Map keys cannot be objects or arrays'); - } + $this->checkTypes(offset: $offset); - if (!$this->checkType($this->keyType, $offset)) { - throw new TypeError(sprintf('Key should be of value %s.', $this->keyType)); - } - if (!$this->map->offsetExists($offset)) { + if (!$this->map->offsetExists(offset: $offset)) { return null; } - return $this->map->offsetGet($offset); + + return $this->map->offsetGet(offset: $offset); } /** * @inheritDoc */ - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { - if (is_array($offset) || is_object($offset)) { - throw new InvalidArgumentException('Map keys cannot be objects or arrays'); - } + $this->checkTypes($offset, $value); - if (!$this->checkType($this->keyType, $offset)) { - throw new TypeError(sprintf('Key should be of value %s.', $this->keyType)); - } - - if (!$this->checkType($this->valueType, $value)) { - throw new ValueError(sprintf('Value should be of type %s.', $this->valueType)); - } - - $this->map->offsetSet($offset, $value); + $this->map->offsetSet(offset: $offset, value: $value); } /** * @inheritDoc */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { - if (is_array($offset) || is_object($offset)) { - throw new InvalidArgumentException('Map keys cannot be objects or arrays'); - } + $this->checkTypes(offset: $offset); - if (!$this->checkType($this->keyType, $offset)) { - throw new TypeError(sprintf('Key should be of value %s.', $this->keyType)); - } - - $this->map->offsetUnset($offset); + $this->map->offsetUnset(offset: $offset); } /** @@ -175,61 +152,69 @@ class GenericMap implements ArrayAccess, Countable protected function assertInitialValues(array $initialValues): bool { foreach ($initialValues as $key => $value) { - if (!$this->checkType($this->keyType, $key) || !$this->checkType($this->valueType, $value)) { - throw new InvalidArgumentException(sprintf('Invalid types for map [%s => %s], they should be [%s => %s]', get_debug_type($key), get_debug_type($value), $this->keyType, $this->valueType)); + if (!$this->checkType(type: $this->keyType, var: $key) || !$this->checkType(type: $this->valueType, var: $value)) { + throw new InvalidArgumentException(message: sprintf('Invalid types for map [%s => %s], they should be [%s => %s]', get_debug_type(value: $key), get_debug_type(value: $value), $this->keyType, $this->valueType)); } } return true; } + private function checkTypes(mixed $offset, mixed $value = null): void + { + if (is_array(value: $offset) || is_object(value: $offset)) { + throw new InvalidArgumentException(message: 'Map keys cannot be objects or arrays'); + } + + if (!$this->checkType(type: $this->keyType, var: $offset)) { + throw new TypeError(message: sprintf('Key should be of value %s.', $this->keyType)); + } + + if (null !== $value && !$this->checkType(type: $this->valueType, var: $value)) { + throw new ValueError(message: sprintf('Value should be of type %s.', $this->valueType)); + } + } + /** * @codeCoverageIgnore * @param string $type - * @param $var + * @param mixed $var * * @return bool */ - private function checkType(string $type, $var): bool + private function checkType(string $type, mixed $var): bool { - switch ($type) { - case self::OBJECT: - return is_object($var); - case self::CALLABLE: - return is_callable($var); - case self::ARRAY: - return is_array($var); - case self::INT: - case self::INTEGER: - return is_int($var); - case self::STRING: - return is_string($var); - case self::CHAR: - return is_string($var) && \mb_strlen($var) === 1; - case self::ANY: - return true; - default: - return $var instanceof $type; - } + return match ($type) { + self::OBJECT => is_object(value: $var), + self::CALLABLE => is_callable(value: $var), + self::ARRAY => is_array(value: $var), + self::INT, self::INTEGER => is_int(value: $var), + self::STRING => is_string(value: $var), + self::CHAR => is_string(value: $var) && (function_exists('mb_strlen') ? mb_strlen(string: $var) === 1 : strlen(string: $var) === 1), + self::ENUM => is_object(value: $var) && enum_exists(enum: $var::class), + self::ANY => true, + default => $var instanceof $type, + }; } + private function isValidKeyType(string $type): bool { - return in_array($type, [ + return in_array(needle: $type, haystack: [ self::INT, self::INTEGER, self::STRING, self::CHAR, self::ANY, - ], true); + ], strict: true); } private function isValidValueType(string $type): bool { - if (class_exists($type)) { + if (class_exists(class: $type)) { return true; } - return in_array($type, [ + return in_array(needle: $type, haystack: [ self::OBJECT, self::CALLABLE, self::ARRAY, @@ -237,7 +222,8 @@ class GenericMap implements ArrayAccess, Countable self::INTEGER, self::STRING, self::CHAR, + self::ENUM, self::ANY, - ], true); + ], strict: true); } } diff --git a/src/Olivebbs/Map/ImmutableMap.php b/src/Olivebbs/Map/ImmutableMap.php index 0920980..9e5aebd 100644 --- a/src/Olivebbs/Map/ImmutableMap.php +++ b/src/Olivebbs/Map/ImmutableMap.php @@ -32,28 +32,28 @@ use Olivebbs\Map\Exception\ImmutableMapException; class ImmutableMap extends GenericMap { private function __construct( - ?string $keyType, - ?string $valueType, - array $values + string $keyType, + string $valueType, + array $values ) { - parent::__construct($keyType, $valueType); + parent::__construct(keyType: $keyType, valueType: $valueType); - $this->assertInitialValues($values); - $this->map->putAll($values); + $this->assertInitialValues(initialValues: $values); + $this->map->putAll(values: $values); } - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { - throw new ImmutableMapException(sprintf('Cannot change values in %s', __CLASS__)); + throw new ImmutableMapException(message: sprintf('Cannot change values in %s', __CLASS__)); } - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { - throw new ImmutableMapException(sprintf('Cannot unset values in %s', __CLASS__)); + throw new ImmutableMapException(message: sprintf('Cannot unset values in %s', __CLASS__)); } - public static function create(string $keyType, string $valueType, array $values): ImmutableMap + public static function create(string $keyType, string $valueType, array $values): static { - return new self($keyType, $valueType, $values); + return new static(keyType: $keyType, valueType: $valueType, values: $values); } } diff --git a/src/Olivebbs/Map/IntCharMap.php b/src/Olivebbs/Map/IntCharMap.php index f78cdc4..86bcb18 100644 --- a/src/Olivebbs/Map/IntCharMap.php +++ b/src/Olivebbs/Map/IntCharMap.php @@ -33,14 +33,14 @@ class IntCharMap extends GenericMap { public function __construct(array $initialValues = []) { - parent::__construct(self::INT, self::CHAR); + parent::__construct(keyType: self::INT, valueType: self::CHAR); - $this->map->putAll($initialValues); + $this->map->putAll(values: $initialValues); } - public static function fromString(string $string): IntCharMap + public static function fromString(string $string): static { - $values = str_split($string); - return new self($values); + $values = str_split(string: $string); + return new static(initialValues: $values); } } diff --git a/tests/GenericMapTest.php b/tests/GenericMapTest.php index 77379e6..99e6768 100644 --- a/tests/GenericMapTest.php +++ b/tests/GenericMapTest.php @@ -167,6 +167,22 @@ class GenericMapTest extends TestCase $genericMap[$object] = 1; } + public function testEnumMap(): void + { + $enumMap = new class(TestEnum::cases()) extends GenericMap { + public function __construct(array $values = []) + { + parent::__construct(self::INT, self::ENUM); + $this->assertInitialValues($values); + $this->map->putAll($values); + } + }; + + self::assertCount(8, $enumMap->toArray()); + self::assertSame(TestEnum::a, $enumMap[0]); + self::assertSame(TestEnum::h, $enumMap[7]); + } + private function resetGenericMap(): void { $this->genericMap = $this->getGenericMap(); diff --git a/tests/TestEnum.php b/tests/TestEnum.php new file mode 100644 index 0000000..d05d16f --- /dev/null +++ b/tests/TestEnum.php @@ -0,0 +1,40 @@ +