From 000076dae78eb05050b56fd702844a22d23c395d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Planchat?= Date: Mon, 13 Nov 2023 18:10:24 +0100 Subject: [PATCH] Fixing PHPStan level 9 issues --- composer.lock | 768 ++++++++-------------- src/Extractor/ArrayExtractor.php | 5 + src/Extractor/IteratorExtractor.php | 6 +- src/GeneratorWrapper.php | 12 + src/IteratorLoggingWrapper.php | 137 ---- src/Loader/DebugLoader.php | 10 +- src/Loader/JSONStreamLoader.php | 10 +- src/Loader/LogLoader.php | 8 +- src/Loader/StderrLoader.php | 10 +- src/Loader/StdoutLoader.php | 10 +- src/Loader/StreamLoader.php | 11 +- src/Pipeline.php | 8 +- src/PipelineRunner.php | 49 +- src/Transformer/BatchingTransformer.php | 38 +- src/Transformer/CallableTransformer.php | 26 +- src/Transformer/ColumnTrimTransformer.php | 9 +- src/Transformer/FilterTransformer.php | 16 +- src/UnexpectedYieldedValueType.php | 27 +- 18 files changed, 466 insertions(+), 694 deletions(-) delete mode 100644 src/IteratorLoggingWrapper.php diff --git a/composer.lock b/composer.lock index 3b14bd4..be7e267 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": "2303e9c21649835612b5cdf4c66f5d0b", + "content-hash": "19f3f0589f701d6b3dcf9169515b6ed9", "packages": [ { "name": "php-etl/bucket", @@ -122,12 +122,12 @@ "source": { "type": "git", "url": "https://github.com/php-etl/pipeline-contracts.git", - "reference": "ad3984db5bbf68104b1c01f3dc8a19c31a95ad4f" + "reference": "632e119b1cf722955870cac1120e92e30f705c48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-etl/pipeline-contracts/zipball/ad3984db5bbf68104b1c01f3dc8a19c31a95ad4f", - "reference": "ad3984db5bbf68104b1c01f3dc8a19c31a95ad4f", + "url": "https://api.github.com/repos/php-etl/pipeline-contracts/zipball/632e119b1cf722955870cac1120e92e30f705c48", + "reference": "632e119b1cf722955870cac1120e92e30f705c48", "shasum": "" }, "require": { @@ -171,7 +171,7 @@ "issues": "https://github.com/php-etl/pipeline-contracts/issues", "source": "https://github.com/php-etl/pipeline-contracts/tree/main" }, - "time": "2023-11-13T13:11:27+00:00" + "time": "2023-11-13T16:40:59+00:00" }, { "name": "php-etl/satellite-contracts", @@ -370,16 +370,16 @@ }, { "name": "composer/pcre", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", "shasum": "" }, "require": { @@ -421,7 +421,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" + "source": "https://github.com/composer/pcre/tree/3.1.1" }, "funding": [ { @@ -437,20 +437,20 @@ "type": "tidelift" } ], - "time": "2022-11-17T09:50:14+00:00" + "time": "2023-10-11T07:11:09+00:00" }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { @@ -500,9 +500,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { @@ -518,7 +518,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/xdebug-handler", @@ -586,159 +586,6 @@ ], "time": "2022-02-25T21:32:43+00:00" }, - { - "name": "doctrine/annotations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" - }, - "time": "2023-02-02T22:02:53+00:00" - }, - { - "name": "doctrine/lexer", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "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": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" - }, - "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-12-15T16:57:16+00:00" - }, { "name": "fidry/cpu-core-counter", "version": "0.4.1", @@ -802,23 +649,21 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.16.0", + "version": "v3.38.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc" + "reference": "7e6070026e76aa09d77a47519625c86593fb8e31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7e6070026e76aa09d77a47519625c86593fb8e31", + "reference": "7e6070026e76aa09d77a47519625c86593fb8e31", "shasum": "" }, "require": { "composer/semver": "^3.3", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^2", - "doctrine/lexer": "^2 || ^3", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", @@ -835,6 +680,7 @@ "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^2.0", "mikey179/vfsstream": "^1.6.11", @@ -845,8 +691,6 @@ "phpspec/prophecy": "^1.16", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", "symfony/phpunit-bridge": "^6.2.3", "symfony/yaml": "^5.4 || ^6.0" }, @@ -886,7 +730,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.38.0" }, "funding": [ { @@ -894,7 +738,7 @@ "type": "github" } ], - "time": "2023-04-02T19:30:06+00:00" + "time": "2023-11-07T08:44:54+00:00" }, { "name": "infection/abstract-testframework-adapter", @@ -1075,16 +919,16 @@ }, { "name": "infection/infection", - "version": "0.26.19", + "version": "0.26.21", "source": { "type": "git", "url": "https://github.com/infection/infection.git", - "reference": "bd7351c88f3a797ea8977e68fe6a3f4d4c5f457f" + "reference": "9bbe4994d204587e0e27475e6681b66608a690a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/bd7351c88f3a797ea8977e68fe6a3f4d4c5f457f", - "reference": "bd7351c88f3a797ea8977e68fe6a3f4d4c5f457f", + "url": "https://api.github.com/repos/infection/infection/zipball/9bbe4994d204587e0e27475e6681b66608a690a9", + "reference": "9bbe4994d204587e0e27475e6681b66608a690a9", "shasum": "" }, "require": { @@ -1102,7 +946,7 @@ "justinrainbow/json-schema": "^5.2.10", "nikic/php-parser": "^4.15.1", "ondram/ci-detector": "^4.1.0", - "php": "^8.0", + "php": "^8.1", "sanmai/later": "^0.1.1", "sanmai/pipeline": "^5.1 || ^6", "sebastian/diff": "^3.0.2 || ^4.0 || ^5.0", @@ -1114,6 +958,7 @@ "webmozart/assert": "^1.11" }, "conflict": { + "antecedent/patchwork": "<2.1.25", "dg/bypass-finals": "<1.4.1", "phpunit/php-code-coverage": ">9,<9.1.4 || >9.2.17,<9.2.21" }, @@ -1122,6 +967,7 @@ "ext-simplexml": "*", "fidry/makefile": "^0.2.0", "helmich/phpunit-json-assert": "^3.0", + "phpspec/prophecy": "^1.15", "phpspec/prophecy-phpunit": "^2.0", "phpstan/extension-installer": "^1.1.0", "phpstan/phpstan": "^1.3.0", @@ -1187,7 +1033,7 @@ ], "support": { "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.26.19" + "source": "https://github.com/infection/infection/tree/0.26.21" }, "funding": [ { @@ -1199,20 +1045,20 @@ "type": "open_collective" } ], - "time": "2023-02-05T21:47:26+00:00" + "time": "2023-04-25T19:40:27+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.12", + "version": "v5.2.13", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, "require": { @@ -1267,9 +1113,9 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" }, - "time": "2022-04-13T08:02:27+00:00" + "time": "2023-09-26T02:20:38+00:00" }, { "name": "myclabs/deep-copy", @@ -1332,16 +1178,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -1382,9 +1228,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "ondram/ci-detector", @@ -1577,16 +1423,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.12", + "version": "1.10.41", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "7b2aaf999e522e2b10011a594cf06dc37de7fbd8" + "reference": "c6174523c2a69231df55bdc65b61655e72876d76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7b2aaf999e522e2b10011a594cf06dc37de7fbd8", - "reference": "7b2aaf999e522e2b10011a594cf06dc37de7fbd8", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c6174523c2a69231df55bdc65b61655e72876d76", + "reference": "c6174523c2a69231df55bdc65b61655e72876d76", "shasum": "" }, "require": { @@ -1635,20 +1481,20 @@ "type": "tidelift" } ], - "time": "2023-04-12T10:33:29+00:00" + "time": "2023-11-05T12:57:57+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.0.2", + "version": "10.1.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4" + "reference": "355324ca4980b8916c18b9db29f3ef484078f26e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/355324ca4980b8916c18b9db29f3ef484078f26e", + "reference": "355324ca4980b8916c18b9db29f3ef484078f26e", "shasum": "" }, "require": { @@ -1667,7 +1513,7 @@ "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -1676,7 +1522,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -1704,7 +1550,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.7" }, "funding": [ { @@ -1712,20 +1559,20 @@ "type": "github" } ], - "time": "2023-03-06T13:00:19+00:00" + "time": "2023-10-04T15:34:17+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "4.0.1", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { @@ -1764,7 +1611,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -1772,7 +1620,7 @@ "type": "github" } ], - "time": "2023-02-10T16:53:14+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", @@ -1839,16 +1687,16 @@ }, { "name": "phpunit/php-text-template", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { @@ -1886,7 +1734,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -1894,7 +1743,7 @@ "type": "github" } ], - "time": "2023-02-03T06:56:46+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", @@ -1957,16 +1806,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.19", + "version": "10.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62" + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/20c23e85c86e5c06d63538ba464e8054f4744e62", - "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", "shasum": "" }, "require": { @@ -1980,7 +1829,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.0", + "phpunit/php-code-coverage": "^10.1.5", "phpunit/php-file-iterator": "^4.0", "phpunit/php-invoker": "^4.0", "phpunit/php-text-template": "^3.0", @@ -1990,8 +1839,8 @@ "sebastian/comparator": "^5.0", "sebastian/diff": "^5.0", "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.0", - "sebastian/global-state": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", "sebastian/object-enumerator": "^5.0", "sebastian/recursion-context": "^5.0", "sebastian/type": "^4.0", @@ -2006,7 +1855,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.4-dev" } }, "autoload": { @@ -2038,7 +1887,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" }, "funding": [ { @@ -2054,56 +1903,7 @@ "type": "tidelift" } ], - "time": "2023-03-27T11:46:33+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" + "time": "2023-10-26T07:21:45+00:00" }, { "name": "psr/container", @@ -2210,21 +2010,21 @@ }, { "name": "rector/rector", - "version": "0.15.24", + "version": "0.15.25", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59" + "reference": "015935c7ed9e48a4f5895ba974f337e20a263841" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/716473919bcfdc27bdd2a32afb72adbf4c224e59", - "reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/015935c7ed9e48a4f5895ba974f337e20a263841", + "reference": "015935c7ed9e48a4f5895ba974f337e20a263841", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.1" + "phpstan/phpstan": "^1.10.14" }, "conflict": { "rector/rector-doctrine": "*", @@ -2259,7 +2059,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.24" + "source": "https://github.com/rectorphp/rector/tree/0.15.25" }, "funding": [ { @@ -2267,35 +2067,41 @@ "type": "github" } ], - "time": "2023-04-05T08:49:11+00:00" + "time": "2023-04-20T16:07:39+00:00" }, { "name": "sanmai/later", - "version": "0.1.2", + "version": "0.1.3", "source": { "type": "git", "url": "https://github.com/sanmai/later.git", - "reference": "9b659fecef2030193fd02402955bc39629d5606f" + "reference": "88a1d39965aa3659ceb96622e2801b9194d16e2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/later/zipball/9b659fecef2030193fd02402955bc39629d5606f", - "reference": "9b659fecef2030193fd02402955bc39629d5606f", + "url": "https://api.github.com/repos/sanmai/later/zipball/88a1d39965aa3659ceb96622e2801b9194d16e2c", + "reference": "88a1d39965aa3659ceb96622e2801b9194d16e2c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.13", - "infection/infection": ">=0.10.5", + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^3.35.1", + "infection/infection": ">=0.27.6", "phan/phan": ">=2", "php-coveralls/php-coveralls": "^2.0", - "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": ">=7.4", + "phpstan/phpstan": ">=1.4.5", + "phpunit/phpunit": ">=9.5 <10", "vimeo/psalm": ">=2" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + } + }, "autoload": { "files": [ "src/functions.php" @@ -2317,7 +2123,7 @@ "description": "Later: deferred wrapper object", "support": { "issues": "https://github.com/sanmai/later/issues", - "source": "https://github.com/sanmai/later/tree/0.1.2" + "source": "https://github.com/sanmai/later/tree/0.1.3" }, "funding": [ { @@ -2325,34 +2131,34 @@ "type": "github" } ], - "time": "2021-01-02T10:26:44+00:00" + "time": "2023-10-23T13:38:10+00:00" }, { "name": "sanmai/pipeline", - "version": "v6.4", + "version": "v6.9", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "9260c4d05da37d67a69075858f41a6e7fff43743" + "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/9260c4d05da37d67a69075858f41a6e7fff43743", - "reference": "9260c4d05da37d67a69075858f41a6e7fff43743", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/c48f45c22c3ce4140d071f7658fb151df1cc08ea", + "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.8", - "friendsofphp/php-cs-fixer": "^3", + "friendsofphp/php-cs-fixer": "^3.17", "infection/infection": ">=0.10.5", "league/pipeline": "^0.3 || ^1.0", "phan/phan": ">=1.1", "php-coveralls/php-coveralls": "^2.4.1", "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": "^7.4 || ^8.1 || ^9.4", + "phpunit/phpunit": ">=9.4", "vimeo/psalm": ">=2" }, "type": "library", @@ -2382,7 +2188,7 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.4" + "source": "https://github.com/sanmai/pipeline/tree/v6.9" }, "funding": [ { @@ -2390,7 +2196,7 @@ "type": "github" } ], - "time": "2023-04-12T06:45:27+00:00" + "time": "2023-10-08T11:56:54+00:00" }, { "name": "sebastian/cli-parser", @@ -2561,16 +2367,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { @@ -2581,7 +2387,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { @@ -2625,7 +2431,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -2633,20 +2440,20 @@ "type": "github" } ], - "time": "2023-02-03T07:07:16+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" + "reference": "68cfb347a44871f01e33ab0ef8215966432f6957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68cfb347a44871f01e33ab0ef8215966432f6957", + "reference": "68cfb347a44871f01e33ab0ef8215966432f6957", "shasum": "" }, "require": { @@ -2659,7 +2466,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.1-dev" } }, "autoload": { @@ -2682,7 +2489,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.1.0" }, "funding": [ { @@ -2690,20 +2498,20 @@ "type": "github" } ], - "time": "2023-02-03T06:59:47+00:00" + "time": "2023-09-28T11:50:59+00:00" }, { "name": "sebastian/diff", - "version": "5.0.1", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", - "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { @@ -2749,7 +2557,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -2757,7 +2565,7 @@ "type": "github" } ], - "time": "2023-03-23T05:12:41+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", @@ -2825,16 +2633,16 @@ }, { "name": "sebastian/exporter", - "version": "5.0.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", "shasum": "" }, "require": { @@ -2848,7 +2656,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2890,7 +2698,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" }, "funding": [ { @@ -2898,20 +2707,20 @@ "type": "github" } ], - "time": "2023-02-03T07:06:49+00:00" + "time": "2023-09-24T13:22:09+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "aab257c712de87b90194febd52e4d184551c2d44" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", - "reference": "aab257c712de87b90194febd52e4d184551c2d44", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "shasum": "" }, "require": { @@ -2951,7 +2760,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -2959,20 +2769,20 @@ "type": "github" } ], - "time": "2023-02-03T07:07:38+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", "shasum": "" }, "require": { @@ -3008,7 +2818,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" }, "funding": [ { @@ -3016,7 +2827,7 @@ "type": "github" } ], - "time": "2023-02-03T07:08:02+00:00" + "time": "2023-08-31T09:25:50+00:00" }, { "name": "sebastian/object-enumerator", @@ -3304,23 +3115,23 @@ }, { "name": "symfony/console", - "version": "v6.2.8", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b" + "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3582d68a64a86ec25240aaa521ec8bc2342b369b", - "reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b", + "url": "https://api.github.com/repos/symfony/console/zipball/0d14a9f6d04d4ac38a8cea1171f4554e325dae92", + "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/string": "^5.4|^6.0" }, "conflict": { @@ -3342,12 +3153,6 @@ "symfony/process": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0" }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, "type": "library", "autoload": { "psr-4": { @@ -3380,7 +3185,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.8" + "source": "https://github.com/symfony/console/tree/v6.3.8" }, "funding": [ { @@ -3396,20 +3201,20 @@ "type": "tidelift" } ], - "time": "2023-03-29T21:42:15+00:00" + "time": "2023-10-31T08:09:35+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { @@ -3418,7 +3223,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -3447,7 +3252,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" }, "funding": [ { @@ -3463,28 +3268,29 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.2.8", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339" + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04046f35fd7d72f9646e721fc2ecb8f9c67d3339", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -3497,13 +3303,9 @@ "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/service-contracts": "^2.5|^3", "symfony/stopwatch": "^5.4|^6.0" }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, "type": "library", "autoload": { "psr-4": { @@ -3530,7 +3332,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/v6.2.8" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2" }, "funding": [ { @@ -3546,33 +3348,30 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:06:02+00:00" + "time": "2023-07-06T06:56:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -3609,7 +3408,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" }, "funding": [ { @@ -3625,20 +3424,20 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/filesystem", - "version": "v6.2.7", + "version": "v6.3.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "82b6c62b959f642d000456f08c6d219d749215b3" + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3", - "reference": "82b6c62b959f642d000456f08c6d219d749215b3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", "shasum": "" }, "require": { @@ -3672,7 +3471,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.7" + "source": "https://github.com/symfony/filesystem/tree/v6.3.1" }, "funding": [ { @@ -3688,20 +3487,20 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:44:56+00:00" + "time": "2023-06-01T08:30:39+00:00" }, { "name": "symfony/finder", - "version": "v6.2.7", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" + "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", + "url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4", + "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4", "shasum": "" }, "require": { @@ -3736,7 +3535,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.2.7" + "source": "https://github.com/symfony/finder/tree/v6.3.5" }, "funding": [ { @@ -3752,25 +3551,25 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:57:23+00:00" + "time": "2023-09-26T12:56:25+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.2.7", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629" + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -3803,7 +3602,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.2.7" + "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" }, "funding": [ { @@ -3819,20 +3618,20 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:44:56+00:00" + "time": "2023-05-12T14:21:09+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -3847,7 +3646,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3885,7 +3684,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -3901,20 +3700,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -3926,7 +3725,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3966,7 +3765,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -3982,20 +3781,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -4007,7 +3806,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4050,7 +3849,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -4066,20 +3865,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -4094,7 +3893,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4133,7 +3932,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -4149,20 +3948,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -4171,7 +3970,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4216,7 +4015,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -4232,20 +4031,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { @@ -4254,7 +4053,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4295,7 +4094,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { @@ -4311,20 +4110,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v6.2.8", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "75ed64103df4f6615e15a7fe38b8111099f47416" + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/75ed64103df4f6615e15a7fe38b8111099f47416", - "reference": "75ed64103df4f6615e15a7fe38b8111099f47416", + "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", "shasum": "" }, "require": { @@ -4356,7 +4155,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.8" + "source": "https://github.com/symfony/process/tree/v6.3.4" }, "funding": [ { @@ -4372,20 +4171,20 @@ "type": "tidelift" } ], - "time": "2023-03-09T16:20:02+00:00" + "time": "2023-08-07T10:39:22+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "shasum": "" }, "require": { @@ -4395,13 +4194,10 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -4441,7 +4237,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" }, "funding": [ { @@ -4457,25 +4253,25 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.2.7", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f" + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -4503,7 +4299,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.2.7" + "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" }, "funding": [ { @@ -4519,20 +4315,20 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:44:56+00:00" + "time": "2023-02-16T10:14:28+00:00" }, { "name": "symfony/string", - "version": "v6.2.8", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" + "reference": "13880a87790c76ef994c91e87efb96134522577a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", + "url": "https://api.github.com/repos/symfony/string/zipball/13880a87790c76ef994c91e87efb96134522577a", + "reference": "13880a87790c76ef994c91e87efb96134522577a", "shasum": "" }, "require": { @@ -4543,13 +4339,13 @@ "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -4589,7 +4385,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.8" + "source": "https://github.com/symfony/string/tree/v6.3.8" }, "funding": [ { @@ -4605,7 +4401,7 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:06:02+00:00" + "time": "2023-11-09T08:28:21+00:00" }, { "name": "thecodingmachine/safe", diff --git a/src/Extractor/ArrayExtractor.php b/src/Extractor/ArrayExtractor.php index e6cfa47..b79e0d8 100644 --- a/src/Extractor/ArrayExtractor.php +++ b/src/Extractor/ArrayExtractor.php @@ -6,8 +6,13 @@ use Kiboko\Contract\Pipeline\ExtractorInterface; +/** + * @template Type + * @implements ExtractorInterface + */ class ArrayExtractor implements ExtractorInterface { + /** @param non-empty-array $data */ public function __construct(private readonly array $data) { } diff --git a/src/Extractor/IteratorExtractor.php b/src/Extractor/IteratorExtractor.php index d628c56..0c79abf 100644 --- a/src/Extractor/IteratorExtractor.php +++ b/src/Extractor/IteratorExtractor.php @@ -4,11 +4,15 @@ namespace Kiboko\Component\Pipeline\Extractor; -use Kiboko\Component\Bucket\AcceptanceResultBucket; use Kiboko\Contract\Pipeline\ExtractorInterface; +/** + * @template Type + * @implements ExtractorInterface + */ class IteratorExtractor implements ExtractorInterface { + /** @param \Traversable $traversable */ public function __construct(private readonly \Traversable $traversable) { } diff --git a/src/GeneratorWrapper.php b/src/GeneratorWrapper.php index b147212..f319060 100644 --- a/src/GeneratorWrapper.php +++ b/src/GeneratorWrapper.php @@ -4,8 +4,14 @@ namespace Kiboko\Component\Pipeline; +use Kiboko\Contract\Bucket\ResultBucketInterface; + +/** + * @template Type + */ class GeneratorWrapper { + /** @param \Iterator ...$iterators */ public function rewind(\Iterator ...$iterators): void { foreach ($iterators as $iterator) { @@ -13,6 +19,7 @@ public function rewind(\Iterator ...$iterators): void } } + /** @param \Iterator ...$iterators */ public function next(\Iterator ...$iterators): void { foreach ($iterators as $iterator) { @@ -20,6 +27,7 @@ public function next(\Iterator ...$iterators): void } } + /** @param \Iterator ...$iterators */ public function valid(\Iterator ...$iterators): bool { foreach ($iterators as $iterator) { @@ -31,6 +39,10 @@ public function valid(\Iterator ...$iterators): bool return true; } + /** + * @param Type $value + * @param \Generator, Type|null, void> ...$generators + */ public function send($value, \Generator ...$generators): \Generator { foreach ($generators as $generator) { diff --git a/src/IteratorLoggingWrapper.php b/src/IteratorLoggingWrapper.php deleted file mode 100644 index b309d4a..0000000 --- a/src/IteratorLoggingWrapper.php +++ /dev/null @@ -1,137 +0,0 @@ -wrapped instanceof \Generator) { - try { - $this->reflectionGenerator = new \ReflectionGenerator($this->wrapped); - } catch (\ReflectionException $e) { - throw new \RuntimeException('An error occured during reflection.', 0, $e); - } - } - - try { - $this->reflectionObject = new \ReflectionObject($this->wrapped); - } catch (\ReflectionException $e) { - throw new \RuntimeException('An error occured during reflection.', 0, $e); - } - } - - private function debug(string $calledMethod, \Iterator $iterator, $value = null): void - { - try { - $message = 'Wrapped %type%->%iter% [%object%]: '; - if (null !== $this->reflectionGenerator) { - $function = $this->reflectionGenerator->getFunction(); - $functionName = $function->getName(); - - if ($function instanceof \ReflectionMethod) { - $class = $function->getDeclaringClass(); - $functionName = $class->getName().'::'.$function->getName(); - } - - $options = [ - 'iter' => $calledMethod, - 'object' => spl_object_hash($this->wrapped), - 'function' => var_export($functionName, true), - 'file' => var_export($this->reflectionGenerator->getExecutingFile(), true), - 'line' => var_export($this->reflectionGenerator->getExecutingLine(), true), - 'type' => $this->wrapped instanceof \Generator ? 'generator' : 'iterator', - ]; - } else { - $message = 'Wrapped %type%->%iter% [%object%]: [terminated] '; - - $options = [ - 'iter' => $calledMethod, - 'object' => spl_object_hash($this->wrapped), - 'type' => $this->wrapped instanceof \Generator ? 'generator' : 'iterator', - ]; - } - } catch (\ReflectionException) { - $message = 'Wrapped %type%->%iter% [%object%]: [terminated] '; - - $options = [ - 'iter' => $calledMethod, - 'object' => spl_object_hash($this->wrapped), - 'type' => $this->wrapped instanceof \Generator ? 'generator' : 'iterator', - ]; - } - - if (2 === \func_num_args()) { - $options = array_merge( - $options, - [ - 'value' => var_export($options, true), - ] - ); - } - - $parameters = []; - $fields = []; - foreach ($options as $key => $value) { - if (!\in_array($key, ['type', 'iter', 'object'])) { - $fields[] = $key.'=%'.$key.'%'; - $parameters['%'.$key.'%'] = var_export($value, true); - } else { - $parameters['%'.$key.'%'] = $value; - } - } - - $message .= implode(', ', $fields); - - $this->logger->debug(strtr($message, $parameters)); - } - - public function current(): mixed - { - $current = $this->wrapped->current(); - - $this->debug(__FUNCTION__, $this->wrapped, $current); - - return $current; - } - - public function next(): void - { - $this->wrapped->next(); - - $this->debug(__FUNCTION__, $this->wrapped); - } - - public function key(): mixed - { - $key = $this->wrapped->key(); - - $this->debug(__FUNCTION__, $this->wrapped, $key); - - return $key; - } - - public function valid(): bool - { - $valid = $this->wrapped->valid(); - - $this->debug(__FUNCTION__, $this->wrapped); - - return $valid; - } - - public function rewind(): void - { - $this->wrapped->rewind(); - - $this->debug(__FUNCTION__, $this->wrapped); - } -} diff --git a/src/Loader/DebugLoader.php b/src/Loader/DebugLoader.php index 3c83320..59286f0 100644 --- a/src/Loader/DebugLoader.php +++ b/src/Loader/DebugLoader.php @@ -4,9 +4,17 @@ namespace Kiboko\Component\Pipeline\Loader; +/** + * @template Type + * + * @extends StreamLoader + */ final class DebugLoader extends StreamLoader { - protected function formatLine($line) + /** + * @param Type|null $line + */ + protected function formatLine(mixed $line): string { return var_export($line, true).\PHP_EOL; } diff --git a/src/Loader/JSONStreamLoader.php b/src/Loader/JSONStreamLoader.php index 4e9799f..76b4c06 100644 --- a/src/Loader/JSONStreamLoader.php +++ b/src/Loader/JSONStreamLoader.php @@ -4,9 +4,17 @@ namespace Kiboko\Component\Pipeline\Loader; +/** + * @template Type + * + * @extends StreamLoader + */ final class JSONStreamLoader extends StreamLoader { - protected function formatLine($line) + /** + * @param Type|null $line + */ + protected function formatLine(mixed $line): string { return json_encode($line, \JSON_THROW_ON_ERROR).\PHP_EOL; } diff --git a/src/Loader/LogLoader.php b/src/Loader/LogLoader.php index 511a357..025b1b1 100644 --- a/src/Loader/LogLoader.php +++ b/src/Loader/LogLoader.php @@ -13,7 +13,7 @@ /** * @template Type * - * @template-implements LoaderInterface + * @implements LoaderInterface */ final readonly class LogLoader implements LoaderInterface { @@ -25,8 +25,10 @@ public function __construct(private LoggerInterface $logger, private string $log public function load(): \Generator { $line = yield new EmptyResultBucket(); - do { + /** @phpstan-ignore-next-line */ + while (true) { $this->logger->log($this->logLevel, var_export($line, true)); - } while ($line = yield new AcceptanceResultBucket($line)); + $line = yield new AcceptanceResultBucket($line); + } } } diff --git a/src/Loader/StderrLoader.php b/src/Loader/StderrLoader.php index 3211e12..fa615d7 100644 --- a/src/Loader/StderrLoader.php +++ b/src/Loader/StderrLoader.php @@ -4,6 +4,11 @@ namespace Kiboko\Component\Pipeline\Loader; +/** + * @template Type + * + * @extends StreamLoader + */ final class StderrLoader extends StreamLoader { public function __construct() @@ -11,7 +16,10 @@ public function __construct() parent::__construct(\STDOUT); } - protected function formatLine($line) + /** + * @param Type|null $line + */ + protected function formatLine(mixed $line): string { return var_export($line, true).\PHP_EOL; } diff --git a/src/Loader/StdoutLoader.php b/src/Loader/StdoutLoader.php index 32199dd..0f4b609 100644 --- a/src/Loader/StdoutLoader.php +++ b/src/Loader/StdoutLoader.php @@ -4,6 +4,11 @@ namespace Kiboko\Component\Pipeline\Loader; +/** + * @template Type + * + * @extends StreamLoader + */ final class StdoutLoader extends StreamLoader { public function __construct() @@ -11,7 +16,10 @@ public function __construct() parent::__construct(\STDOUT); } - protected function formatLine($line) + /** + * @param Type|null $line + */ + protected function formatLine(mixed $line): string { return var_export($line, true).\PHP_EOL; } diff --git a/src/Loader/StreamLoader.php b/src/Loader/StreamLoader.php index 7690fad..b1ec393 100644 --- a/src/Loader/StreamLoader.php +++ b/src/Loader/StreamLoader.php @@ -11,7 +11,7 @@ /** * @template Type * - * @template-implements LoaderInterface + * @implements LoaderInterface */ abstract class StreamLoader implements LoaderInterface { @@ -32,11 +32,16 @@ public function __construct($stream) public function load(): \Generator { $line = yield new EmptyResultBucket(); + /** @phpstan-ignore-next-line */ while (true) { - fwrite($this->stream, (string) $this->formatLine($line)); + fwrite($this->stream, $this->formatLine($line)); $line = yield new AcceptanceResultBucket($line); } } - abstract protected function formatLine($line); + /** + * @param Type|null $line + * @return string + */ + abstract protected function formatLine(mixed $line): string; } diff --git a/src/Pipeline.php b/src/Pipeline.php index c476d7a..a707f98 100644 --- a/src/Pipeline.php +++ b/src/Pipeline.php @@ -24,8 +24,12 @@ class Pipeline implements PipelineInterface, WalkableInterface, RunnableInterface { private readonly \AppendIterator $source; + /** @var iterable|\NoRewindIterator */ private iterable $subject; + /** + * @param PipelineRunnerInterface $runner + */ public function __construct( private readonly PipelineRunnerInterface $runner, private readonly StateInterface $state, @@ -45,7 +49,9 @@ public function feed(...$data): void private function passThroughCoroutine(): \Generator { $line = yield; - while ($line = yield $line); + while (true) { + $line = yield $line; + } } public function extract( diff --git a/src/PipelineRunner.php b/src/PipelineRunner.php index 0022641..a9a7ae0 100644 --- a/src/PipelineRunner.php +++ b/src/PipelineRunner.php @@ -18,10 +18,17 @@ use Psr\Log\LogLevel; use Psr\Log\NullLogger; +/** + * @template Type + * + * @implements PipelineRunnerInterface + */ class PipelineRunner implements PipelineRunnerInterface { - public function __construct(private readonly LoggerInterface $logger = new NullLogger(), private readonly string $rejectionLevel = LogLevel::WARNING) - { + public function __construct( + private readonly LoggerInterface $logger = new NullLogger(), + private readonly LogLevel|string $rejectionLevel = LogLevel::WARNING + ) { } public function run( @@ -45,34 +52,18 @@ public function run( } if ($bucket instanceof RejectionResultBucketInterface) { - if ($bucket instanceof RejectionResultBucket) { - foreach ($bucket->walkRejection() as $line) { - $rejection->reject($line); - $state->reject(); + foreach ($bucket->walkRejection() as $line) { + $rejection->reject($line); + $rejection->rejectWithReason($line, implode('', $bucket->reasons())); + $state->reject(); - $this->logger->log( - $this->rejectionLevel, - 'Some data was rejected from the pipeline', - [ - 'line' => $line, - ] - ); - } - } - - if ($bucket instanceof RejectionWithReasonResultBucket) { - foreach ($bucket->walkRejection() as $line) { - $rejection->rejectWithReason($line, $bucket->getReason()); - $state->reject(); - - $this->logger->log( - $this->rejectionLevel, - 'Some data was rejected from the pipeline', - [ - 'line' => $line, - ] - ); - } + $this->logger->log( + $this->rejectionLevel, + 'Some data was rejected from the pipeline', + [ + 'line' => $line, + ] + ); } } diff --git a/src/Transformer/BatchingTransformer.php b/src/Transformer/BatchingTransformer.php index 0b5156a..adf7791 100644 --- a/src/Transformer/BatchingTransformer.php +++ b/src/Transformer/BatchingTransformer.php @@ -4,36 +4,49 @@ namespace Kiboko\Component\Pipeline\Transformer; +use Kiboko\Component\Bucket\AcceptanceAppendableResultBucket; +use Kiboko\Component\Bucket\AcceptanceResultBucket; use Kiboko\Component\Bucket\AppendableIteratorAcceptanceResultBucket; use Kiboko\Component\Bucket\EmptyResultBucket; use Kiboko\Contract\Bucket\ResultBucketInterface; use Kiboko\Contract\Pipeline\FlushableInterface; use Kiboko\Contract\Pipeline\TransformerInterface; -/** @template Type */ +/** + * @template Type + * + * @implements TransformerInterface> + * @implements FlushableInterface> + */ class BatchingTransformer implements TransformerInterface, FlushableInterface { - private ResultBucketInterface $bucket; + /** @var list */ + private array $batch = []; - public function __construct(private readonly int $batchSize) - { - $this->bucket = new EmptyResultBucket(); + public function __construct( + private readonly int $batchSize + ) { } - /** @return \Generator|EmptyResultBucket, Type|null, void> */ + /** @return \Generator>|EmptyResultBucket, Type|null, void> */ public function transform(): \Generator { - $this->bucket = new AppendableIteratorAcceptanceResultBucket(); + $this->batch = []; $itemCount = 0; $line = yield new EmptyResultBucket(); + /** @phpstan-ignore-next-line */ while (true) { - $this->bucket->append($line); + if ($line === null) { + $line = yield new EmptyResultBucket(); + continue; + } + $this->batch[] = $line; if ($this->batchSize <= ++$itemCount) { - $line = yield $this->bucket; + $line = yield new AcceptanceResultBucket($this->batch); $itemCount = 0; - $this->bucket = new AppendableIteratorAcceptanceResultBucket(); + $this->batch = []; } else { $line = yield new EmptyResultBucket(); } @@ -42,6 +55,9 @@ public function transform(): \Generator public function flush(): ResultBucketInterface { - return $this->bucket; + if (count($this->batch) <= 0) { + return new EmptyResultBucket(); + } + return new AcceptanceResultBucket($this->batch); } } diff --git a/src/Transformer/CallableTransformer.php b/src/Transformer/CallableTransformer.php index 7fd2761..5c469f9 100644 --- a/src/Transformer/CallableTransformer.php +++ b/src/Transformer/CallableTransformer.php @@ -8,23 +8,37 @@ use Kiboko\Component\Bucket\EmptyResultBucket; use Kiboko\Contract\Pipeline\TransformerInterface; -/** @template Type */ +/** + * @template InputType + * @template OutputType + * + * @template-implements TransformerInterface + */ class CallableTransformer implements TransformerInterface { - /** @var callable */ + /** @var callable(InputType|null $item): OutputType */ private $callback; + /** + * @param callable(InputType|null $item): OutputType $callback + */ public function __construct( - callable $callback + callable $callback, ) { $this->callback = $callback; } - /** @return \Generator|EmptyResultBucket, Type|null, void> */ + /** + * @return \Generator|EmptyResultBucket, InputType|null, void> + */ public function transform(): \Generator { + $callback = $this->callback; + $line = yield new EmptyResultBucket(); - do { - } while ($line = yield new AcceptanceResultBucket(($this->callback)($line))); + /** @phpstan-ignore-next-line */ + while (true) { + $line = yield new AcceptanceResultBucket($callback($line)); + } } } diff --git a/src/Transformer/ColumnTrimTransformer.php b/src/Transformer/ColumnTrimTransformer.php index a3f87dc..95490f8 100644 --- a/src/Transformer/ColumnTrimTransformer.php +++ b/src/Transformer/ColumnTrimTransformer.php @@ -9,9 +9,7 @@ use Kiboko\Contract\Pipeline\TransformerInterface; /** - * @template Type - * - * @template-implements TransformerInterface + * @template-implements TransformerInterface, non-empty-array> */ class ColumnTrimTransformer implements TransformerInterface { @@ -21,10 +19,13 @@ public function __construct( ) { } - /** @return \Generator|EmptyResultBucket, Type|null, void> */ + /** + * @return \Generator>|EmptyResultBucket, non-empty-array|null, void> + */ public function transform(): \Generator { $line = yield new EmptyResultBucket(); + /** @phpstan-ignore-next-line */ while (true) { if (null === $line) { $line = yield new EmptyResultBucket(); diff --git a/src/Transformer/FilterTransformer.php b/src/Transformer/FilterTransformer.php index e8b6fa1..8f6d082 100644 --- a/src/Transformer/FilterTransformer.php +++ b/src/Transformer/FilterTransformer.php @@ -6,32 +6,36 @@ use Kiboko\Component\Bucket\AcceptanceResultBucket; use Kiboko\Component\Bucket\EmptyResultBucket; -use Kiboko\Component\Metadata\Type; use Kiboko\Contract\Pipeline\TransformerInterface; /** * @template Type * - * @template-implements TransformerInterface + * @template-implements TransformerInterface */ class FilterTransformer implements TransformerInterface { - /** @var callable */ + /** @var callable(Type $item): bool */ private $callback; - public function __construct(callable $callback) - { + /** + * @param callable(Type $item): bool $callback + */ + public function __construct( + callable $callback, + ) { $this->callback = $callback; } /** - * @return \Generator|EmptyResultBucket, Type|null, void> + * @return \Generator|EmptyResultBucket, Type|null, void> */ public function transform(): \Generator { $callback = $this->callback; $line = yield new EmptyResultBucket(); + /** @phpstan-ignore-next-line */ while (true) { if (null === $line || !$callback($line)) { $line = yield new EmptyResultBucket(); diff --git a/src/UnexpectedYieldedValueType.php b/src/UnexpectedYieldedValueType.php index a153d65..cc896ee 100644 --- a/src/UnexpectedYieldedValueType.php +++ b/src/UnexpectedYieldedValueType.php @@ -4,14 +4,35 @@ namespace Kiboko\Component\Pipeline; +use Kiboko\Contract\Bucket\ResultBucketInterface; + +/** + * @template InputType + * @template OutputType + */ final class UnexpectedYieldedValueType extends \UnexpectedValueException { - public function __construct(private readonly \Generator $coroutine, string $message = null, int $code = null, ?\Exception $previous = null) - { + public function __construct( + private readonly \Generator $coroutine, + string $message = '', + int $code = 0, + ?\Throwable $previous = null + ) { parent::__construct($message, $code, $previous); } - public static function expectingTypes(\Generator $coroutine, array $expectedTypes, $actual, int $code = null, ?\Exception $previous = null): self + public function getCoroutine(): \Generator + { + return $this->coroutine; + } + + /** + * @param \Generator, InputType|null, void> $actual + * @param list $expectedTypes + * @param mixed $actual + * @return UnexpectedYieldedValueType + */ + public static function expectingTypes(\Generator $coroutine, array $expectedTypes, $actual, int $code = 0, ?\Throwable $previous = null): self { try { $re = new \ReflectionGenerator($coroutine);