diff --git a/rules/DeadCode/Rector/ClassMethod/RemoveUselessAssignFromPropertyPromotionRector.php b/rules/DeadCode/Rector/ClassMethod/RemoveUselessAssignFromPropertyPromotionRector.php new file mode 100644 index 00000000000..99ca97f7377 --- /dev/null +++ b/rules/DeadCode/Rector/ClassMethod/RemoveUselessAssignFromPropertyPromotionRector.php @@ -0,0 +1,105 @@ +std = $std; + } +} +CODE_SAMPLE +, <<<'CODE_SAMPLE' +class SomeClass +{ + public function __construct(private \stdClass $std) + { + } +} +CODE_SAMPLE +)]); + } + /** + * @return array> + */ + public function getNodeTypes() : array + { + return [ClassMethod::class]; + } + /** + * @param ClassMethod $node + */ + public function refactor(Node $node) : ?Node + { + if (!$this->isName($node, MethodName::CONSTRUCT)) { + return null; + } + if ($node->stmts === null || $node->stmts == []) { + return null; + } + $variableNames = []; + foreach ($node->params as $param) { + if (!$param->isPromoted()) { + continue; + } + // re-assign will cause error on the first place, no need to collect names + // on readonly property promotion + if ($param->isReadonly()) { + continue; + } + $variableNames[] = (string) $this->getName($param->var); + } + if ($variableNames === []) { + return null; + } + $removeStmtKeys = []; + foreach ($node->stmts as $key => $stmt) { + // has non direct expression with assign, skip + if (!$stmt instanceof Expression || !$stmt->expr instanceof Assign) { + return null; + } + /** @var Assign $assign */ + $assign = $stmt->expr; + // has non property fetches assignments, skip + if (!$assign->var instanceof PropertyFetch) { + return null; + } + // collect first, ensure not removed too early on next non property fetch assignment + // which may have side effect + if ($assign->var->var instanceof Variable && $this->isName($assign->var->var, 'this') && $this->isNames($assign->var->name, $variableNames) && $assign->expr instanceof Variable && $this->isName($assign->expr, (string) $this->getName($assign->var->name))) { + $removeStmtKeys[] = $key; + continue; + } + // early return, if not all are property fetches from $this and its param + return null; + } + // empty data? nothing to remove + if ($removeStmtKeys === []) { + return null; + } + foreach ($removeStmtKeys as $removeStmtKey) { + unset($node->stmts[$removeStmtKey]); + } + return $node; + } +} diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 6d41e06f440..090292e5621 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '66d93167af53e4116e73f6dc011f02ac23efbd6f'; + public const PACKAGE_VERSION = 'a1cb33463a604a3b0e232ec423700ee1ff2cf60a'; /** * @api * @var string */ - public const RELEASE_DATE = '2025-01-01 23:32:36'; + public const RELEASE_DATE = '2025-01-04 13:22:49'; /** * @var int */ diff --git a/src/Config/Level/DeadCodeLevel.php b/src/Config/Level/DeadCodeLevel.php index c85129d9f4f..0a442206991 100644 --- a/src/Config/Level/DeadCodeLevel.php +++ b/src/Config/Level/DeadCodeLevel.php @@ -20,6 +20,7 @@ use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector; +use Rector\DeadCode\Rector\ClassMethod\RemoveUselessAssignFromPropertyPromotionRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnExprInConstructRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; @@ -85,6 +86,7 @@ final class DeadCodeLevel RemoveTypedPropertyDeadInstanceOfRector::class, TernaryToBooleanOrFalseToBooleanAndRector::class, RemoveDoubleAssignRector::class, + RemoveUselessAssignFromPropertyPromotionRector::class, RemoveConcatAutocastRector::class, SimplifyIfElseWithSameContentRector::class, SimplifyUselessVariableRector::class, diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index ba28672e2b0..41b6cb81199 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -1316,6 +1316,7 @@ return array( 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPrivateMethodRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPromotedPropertyRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPromotedPropertyRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPublicMethodParameterRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPublicMethodParameterRector.php', + 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessAssignFromPropertyPromotionRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessAssignFromPropertyPromotionRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessParamTagRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessParamTagRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessReturnExprInConstructRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessReturnExprInConstructRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessReturnTagRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessReturnTagRector.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 07f5e9bd39d..617a5302a24 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -1535,6 +1535,7 @@ class ComposerStaticInit4fb50f2d4af661ecee2245f9ff725125 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPrivateMethodRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPromotedPropertyRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPromotedPropertyRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPublicMethodParameterRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPublicMethodParameterRector.php', + 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessAssignFromPropertyPromotionRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessAssignFromPropertyPromotionRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessParamTagRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessParamTagRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessReturnExprInConstructRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessReturnExprInConstructRector.php', 'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUselessReturnTagRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUselessReturnTagRector.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index cb59f2abeb2..f1e1a0a22e0 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -512,8 +512,8 @@ }, { "name": "illuminate\/container", - "version": "v11.36.1", - "version_normalized": "11.36.1.0", + "version": "v11.37.0", + "version_normalized": "11.37.0.0", "source": { "type": "git", "url": "https:\/\/github.com\/illuminate\/container.git", @@ -569,8 +569,8 @@ }, { "name": "illuminate\/contracts", - "version": "v11.36.1", - "version_normalized": "11.36.1.0", + "version": "v11.37.0", + "version_normalized": "11.37.0.0", "source": { "type": "git", "url": "https:\/\/github.com\/illuminate\/contracts.git", @@ -1157,36 +1157,36 @@ }, { "name": "react\/child-process", - "version": "v0.6.5", - "version_normalized": "0.6.5.0", + "version": "v0.6.6", + "version_normalized": "0.6.6.0", "source": { "type": "git", "url": "https:\/\/github.com\/reactphp\/child-process.git", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/reactphp\/child-process\/zipball\/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", - "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "url": "https:\/\/api.github.com\/repos\/reactphp\/child-process\/zipball\/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", "shasum": "" }, "require": { "evenement\/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", "react\/event-loop": "^1.2", - "react\/stream": "^1.2" + "react\/stream": "^1.4" }, "require-dev": { - "phpunit\/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react\/socket": "^1.8", + "phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react\/socket": "^1.16", "sebastian\/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, - "time": "2022-09-16T13:41:56+00:00", + "time": "2025-01-01T16:37:48+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "RectorPrefix202501\\React\\ChildProcess\\": "src" + "RectorPrefix202501\\React\\ChildProcess\\": "src\/" } }, "notification-url": "https:\/\/packagist.org\/downloads\/", @@ -1223,16 +1223,12 @@ ], "support": { "issues": "https:\/\/github.com\/reactphp\/child-process\/issues", - "source": "https:\/\/github.com\/reactphp\/child-process\/tree\/v0.6.5" + "source": "https:\/\/github.com\/reactphp\/child-process\/tree\/v0.6.6" }, "funding": [ { - "url": "https:\/\/github.com\/WyriHaximus", - "type": "github" - }, - { - "url": "https:\/\/github.com\/clue", - "type": "github" + "url": "https:\/\/opencollective.com\/reactphp", + "type": "open_collective" } ], "install-path": "..\/react\/child-process" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index fac2e37a416..af5ecd2f06e 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202501; -return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => 'b2bed4734f0cc156ee1fe9c0da2550420d99a21e', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.3', 'version' => '3.4.3.0', 'reference' => '4313d26ada5e0c4edfbd1dc481a92ff7bff91f12', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.5', 'version' => '3.0.5.0', 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.10', 'version' => '2.0.10.0', 'reference' => '5817d0659c5b50c9b950feb9af7b9668e2c436bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '1.2.0', 'version' => '1.2.0.0', 'reference' => '8520451a140d3f46ac33042715115e290cf5785f', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v11.36.1', 'version' => '11.36.1.0', 'reference' => '4a777578ce2388384565bf5c8e76881f0da68e54', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v11.36.1', 'version' => '11.36.1.0', 'reference' => '184317f701ba20ca265e36808ed54b75b115972d', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.5', 'version' => '4.0.5.0', 'reference' => '736c567e257dbe0fcf6ce81b4d6dbe05c6899f96', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v5.4.0', 'version' => '5.4.0.0', 'reference' => '447a020a1f875a434d62f2a401f53b82a396e494', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.2.0', 'version' => '4.2.0.0', 'reference' => '8b0223b5ed235fd377c75fdd1bfcad05c0f168b8', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '2.0.0', 'version' => '2.0.0.0', 'reference' => 'c00d78fb6b29658347f9d37ebe104bffadf36299', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '2.1.0')), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/log' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.13.0', 'version' => '1.13.0.0', 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.5.0', 'version' => '1.5.0.0', 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.16.0', 'version' => '1.16.0.0', 'reference' => '23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'f740789641b7a6f7e58397a88725a73ca1402d61', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'f9cc5a03dc2a894691d3878adb6e9eef3483281a', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '6b0e4f053e8e3d61ed94b1f7da3944638a5a806b', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '29a1abf5d8e8d6150dabe6e79e001a34236e9499', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '6.0.2', 'version' => '6.0.2.0', 'reference' => 'b4ccd857127db5d41a5b676f24b51371d76d8544', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.17', 'version' => '6.4.17.0', 'reference' => '799445db3f15768ecc382ac5699e6da0520a0a04', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.13', 'version' => '6.4.13.0', 'reference' => '4856c9cf585d5a0313d8d35afd681a526f038dd3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.17', 'version' => '6.4.17.0', 'reference' => '1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.31.0', 'version' => '1.31.0.0', 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.15', 'version' => '6.4.15.0', 'reference' => '3cb242f059c14ae08591c5c4087d1fe443564392', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => 'e53260aabf78fb3d63f8d79d69ece59f80d5eda0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/yaml' => array('pretty_version' => 'v7.2.0', 'version' => '7.2.0.0', 'reference' => '099581e99f557e9f16b43c5916c26380b54abb22', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.2.2', 'version' => '11.2.2.0', 'reference' => '8586c18bb8efb31cd192a4e5cc94ae7813f72ed9', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.2.0', 'version' => '11.2.0.0', 'reference' => '479cfcfd46047f80624aba931d9789e50475b5c6', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); +return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => 'b2bed4734f0cc156ee1fe9c0da2550420d99a21e', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.3', 'version' => '3.4.3.0', 'reference' => '4313d26ada5e0c4edfbd1dc481a92ff7bff91f12', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.5', 'version' => '3.0.5.0', 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.10', 'version' => '2.0.10.0', 'reference' => '5817d0659c5b50c9b950feb9af7b9668e2c436bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '1.2.0', 'version' => '1.2.0.0', 'reference' => '8520451a140d3f46ac33042715115e290cf5785f', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v11.37.0', 'version' => '11.37.0.0', 'reference' => '4a777578ce2388384565bf5c8e76881f0da68e54', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v11.37.0', 'version' => '11.37.0.0', 'reference' => '184317f701ba20ca265e36808ed54b75b115972d', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.5', 'version' => '4.0.5.0', 'reference' => '736c567e257dbe0fcf6ce81b4d6dbe05c6899f96', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v5.4.0', 'version' => '5.4.0.0', 'reference' => '447a020a1f875a434d62f2a401f53b82a396e494', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.2.0', 'version' => '4.2.0.0', 'reference' => '8b0223b5ed235fd377c75fdd1bfcad05c0f168b8', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '2.0.0', 'version' => '2.0.0.0', 'reference' => 'c00d78fb6b29658347f9d37ebe104bffadf36299', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '2.1.0')), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/log' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.6', 'version' => '0.6.6.0', 'reference' => '1721e2b93d89b745664353b9cfc8f155ba8a6159', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.13.0', 'version' => '1.13.0.0', 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.5.0', 'version' => '1.5.0.0', 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.16.0', 'version' => '1.16.0.0', 'reference' => '23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'f740789641b7a6f7e58397a88725a73ca1402d61', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'f9cc5a03dc2a894691d3878adb6e9eef3483281a', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '6b0e4f053e8e3d61ed94b1f7da3944638a5a806b', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '29a1abf5d8e8d6150dabe6e79e001a34236e9499', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '6.0.2', 'version' => '6.0.2.0', 'reference' => 'b4ccd857127db5d41a5b676f24b51371d76d8544', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.17', 'version' => '6.4.17.0', 'reference' => '799445db3f15768ecc382ac5699e6da0520a0a04', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.13', 'version' => '6.4.13.0', 'reference' => '4856c9cf585d5a0313d8d35afd681a526f038dd3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.17', 'version' => '6.4.17.0', 'reference' => '1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.31.0', 'version' => '1.31.0.0', 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.15', 'version' => '6.4.15.0', 'reference' => '3cb242f059c14ae08591c5c4087d1fe443564392', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => 'e53260aabf78fb3d63f8d79d69ece59f80d5eda0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/yaml' => array('pretty_version' => 'v7.2.0', 'version' => '7.2.0.0', 'reference' => '099581e99f557e9f16b43c5916c26380b54abb22', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.2.2', 'version' => '11.2.2.0', 'reference' => '8586c18bb8efb31cd192a4e5cc94ae7813f72ed9', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.2.0', 'version' => '11.2.0.0', 'reference' => '479cfcfd46047f80624aba931d9789e50475b5c6', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); diff --git a/vendor/react/child-process/CHANGELOG.md b/vendor/react/child-process/CHANGELOG.md index 81bf50c5784..5ad759d442f 100644 --- a/vendor/react/child-process/CHANGELOG.md +++ b/vendor/react/child-process/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 0.6.6 (2025-01-01) + +This is a compatibility release that contains backported features from the `0.7.x` branch. +Once v0.7 is released, it will be the way forward for this project. + +* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable types. + (#114 by @clue) + +* Improve test suite to run tests on latest PHP versions and report failed assertions. + (#113 by @clue) + ## 0.6.5 (2022-09-16) * Feature: Full support for PHP 8.1 and PHP 8.2 release. diff --git a/vendor/react/child-process/README.md b/vendor/react/child-process/README.md index 2dc8aab7976..bea72041296 100644 --- a/vendor/react/child-process/README.md +++ b/vendor/react/child-process/README.md @@ -588,7 +588,7 @@ The recommended way to install this library is [through Composer](https://getcom This will install the latest supported version: ```bash -composer require react/child-process:^0.6.5 +composer require react/child-process:^0.6.6 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. diff --git a/vendor/react/child-process/composer.json b/vendor/react/child-process/composer.json index 02f1b006e18..a07bea9dd21 100644 --- a/vendor/react/child-process/composer.json +++ b/vendor/react/child-process/composer.json @@ -33,21 +33,21 @@ "php": ">=5.3.0", "evenement\/evenement": "^3.0 || ^2.0 || ^1.0", "react\/event-loop": "^1.2", - "react\/stream": "^1.2" + "react\/stream": "^1.4" }, "require-dev": { - "phpunit\/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react\/socket": "^1.8", + "phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react\/socket": "^1.16", "sebastian\/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, "autoload": { "psr-4": { - "RectorPrefix202501\\React\\ChildProcess\\": "src" + "RectorPrefix202501\\React\\ChildProcess\\": "src\/" } }, "autoload-dev": { "psr-4": { - "RectorPrefix202501\\React\\Tests\\ChildProcess\\": "tests" + "RectorPrefix202501\\React\\Tests\\ChildProcess\\": "tests\/" } } } \ No newline at end of file diff --git a/vendor/react/child-process/src/Process.php b/vendor/react/child-process/src/Process.php index a2676c0e2b6..284515450f5 100644 --- a/vendor/react/child-process/src/Process.php +++ b/vendor/react/child-process/src/Process.php @@ -103,8 +103,16 @@ class Process extends EventEmitter * @param null|array $fds File descriptors to allocate for this process (or null = default STDIO streams) * @throws \LogicException On windows or when proc_open() is not installed */ - public function __construct($cmd, $cwd = null, array $env = null, array $fds = null) + public function __construct($cmd, $cwd = null, $env = null, $fds = null) { + if ($env !== null && !\is_array($env)) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #3 ($env) expected null|array'); + } + if ($fds !== null && !\is_array($fds)) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #4 ($fds) expected null|array'); + } if (!\function_exists('proc_open')) { throw new \LogicException('The Process class relies on proc_open(), which is not available on your PHP installation.'); } @@ -151,8 +159,12 @@ class Process extends EventEmitter * @param float $interval Interval to periodically monitor process state (seconds) * @throws \RuntimeException If the process is already running or fails to start */ - public function start(LoopInterface $loop = null, $interval = 0.1) + public function start($loop = null, $interval = 0.1) { + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #1 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } if ($this->isRunning()) { throw new \RuntimeException('Process is already running'); }