From 09acbdda133f818e6eeb610fc56d54e7426bb3e3 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 22 Apr 2024 20:26:54 +0000 Subject: [PATCH] Updated Rector to commit 6eac87db32eff9308a037fb32ce973ccf905fc92 https://github.com/rectorphp/rector-src/commit/6eac87db32eff9308a037fb32ce973ccf905fc92 Ignore phpdoc type in RecastingRemovalRector (#5841) --- vendor/composer/installed.json | 8 +- vendor/composer/installed.php | 2 +- .../src/GeneratedConfig.php | 2 +- .../docs/rector_rules_overview.md | 22 +- .../WithConsecutiveRector.php | 192 +++++++++++++++--- 5 files changed, 180 insertions(+), 46 deletions(-) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f16dd0bf1d5..c79472d47a4 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1802,12 +1802,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git", - "reference": "e8af39b93f68f4a7a81c20866600175ae239eb02" + "reference": "b9cff121a6821e6dedfbbfc59f4989c48505438b" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/e8af39b93f68f4a7a81c20866600175ae239eb02", - "reference": "e8af39b93f68f4a7a81c20866600175ae239eb02", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/b9cff121a6821e6dedfbbfc59f4989c48505438b", + "reference": "b9cff121a6821e6dedfbbfc59f4989c48505438b", "shasum": "" }, "require": { @@ -1830,7 +1830,7 @@ "tomasvotruba\/class-leak": "^0.2", "tracy\/tracy": "^2.10" }, - "time": "2024-04-17T07:15:20+00:00", + "time": "2024-04-22T20:22:53+00:00", "default-branch": true, "type": "rector-extension", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a1529098495..5ca6d0b712c 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202404; -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.1.3', 'version' => '3.1.3.0', 'reference' => '5b16e25a5355f1f3afdfc2f954a0a80aec4826a8', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.0', 'version' => '3.4.0.0', 'reference' => '35e8d0af4486141bc745f23a29cc2091eb624a32', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.4', 'version' => '3.0.4.0', 'reference' => '4f988f8fdf580d53bdb2d1278fe93d1ed5462255', '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.1.0', 'version' => '1.1.0.0', 'reference' => 'f92996c4d5c1a696a6a970e20f7c4216200fcc42', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.48.8', 'version' => '10.48.8.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.48.8', 'version' => '10.48.8.0', 'reference' => '8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.4', 'version' => '4.0.4.0', 'reference' => 'd3ad0aa3b9f934602cb3e3902ebccf10be34d218', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.19.1', 'version' => '4.19.1.0', 'reference' => '4e1b88d21c69391150ace211e9eaf05810858d0b', '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' => '1.28.0', 'version' => '1.28.0.0', 'reference' => 'cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '^1.10.57')), '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.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', '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.12.0', 'version' => '1.12.0.0', 'reference' => 'c134600642fa615b46b41237ef243daa65bb64ec', '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' => 'v2.11.0', 'version' => '2.11.0.0', 'reference' => '1a8460931ea36dc5c76838fec5734d55c88c6831', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.15.0', 'version' => '1.15.0.0', 'reference' => '216d3aec0b87f04a40ca04f481e6af01bdd1d038', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '6fbc9672905c7d5a885f2da2fc696f65840f4a66', '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' => 'ea7e84438061f3c39c59cb029e6c55b39002d8f8', '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' => '05e44cfe25504ac9de978b9b977caf207ed0c9e1', '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' => 'e8af39b93f68f4a7a81c20866600175ae239eb02', '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' => 'b8126e8bf6e239fd53329fcd715ea117a4b4c34c', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.1.1', 'version' => '5.1.1.0', 'reference' => 'c41e007b4b62af48218231d6c2275e4c9b975b2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.6', 'version' => '6.4.6.0', 'reference' => 'a2708a5da5c87d1d0d52937bdeac625df659e11f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.4.0', 'version' => '3.4.0.0', 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.6', 'version' => '6.4.6.0', 'reference' => '9919b5509ada52cc7f66f9a35c86a4a29955c9d3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.0', 'version' => '6.4.0.0', 'reference' => '11d736e97f116ac375a81f96e662911a34cd50ce', '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.29.0', 'version' => '1.29.0.0', 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.4', 'version' => '6.4.4.0', 'reference' => '710e27879e9be3395de2b98da3f52a946039f297', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.4.2', 'version' => '3.4.2.0', 'reference' => '11bbf19a0fb7b36345861e85c5768844c552906e', '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' => 'v6.4.3', 'version' => '6.4.3.0', 'reference' => 'd75715985f0f94f978e3a8fa42533e10db921b90', '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.1.3', 'version' => '3.1.3.0', 'reference' => '5b16e25a5355f1f3afdfc2f954a0a80aec4826a8', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.0', 'version' => '3.4.0.0', 'reference' => '35e8d0af4486141bc745f23a29cc2091eb624a32', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.4', 'version' => '3.0.4.0', 'reference' => '4f988f8fdf580d53bdb2d1278fe93d1ed5462255', '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.1.0', 'version' => '1.1.0.0', 'reference' => 'f92996c4d5c1a696a6a970e20f7c4216200fcc42', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.48.8', 'version' => '10.48.8.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.48.8', 'version' => '10.48.8.0', 'reference' => '8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.4', 'version' => '4.0.4.0', 'reference' => 'd3ad0aa3b9f934602cb3e3902ebccf10be34d218', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.19.1', 'version' => '4.19.1.0', 'reference' => '4e1b88d21c69391150ace211e9eaf05810858d0b', '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' => '1.28.0', 'version' => '1.28.0.0', 'reference' => 'cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '^1.10.57')), '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.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', '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.12.0', 'version' => '1.12.0.0', 'reference' => 'c134600642fa615b46b41237ef243daa65bb64ec', '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' => 'v2.11.0', 'version' => '2.11.0.0', 'reference' => '1a8460931ea36dc5c76838fec5734d55c88c6831', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.15.0', 'version' => '1.15.0.0', 'reference' => '216d3aec0b87f04a40ca04f481e6af01bdd1d038', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '6fbc9672905c7d5a885f2da2fc696f65840f4a66', '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' => 'ea7e84438061f3c39c59cb029e6c55b39002d8f8', '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' => '05e44cfe25504ac9de978b9b977caf207ed0c9e1', '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' => 'b9cff121a6821e6dedfbbfc59f4989c48505438b', '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' => 'b8126e8bf6e239fd53329fcd715ea117a4b4c34c', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.1.1', 'version' => '5.1.1.0', 'reference' => 'c41e007b4b62af48218231d6c2275e4c9b975b2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.6', 'version' => '6.4.6.0', 'reference' => 'a2708a5da5c87d1d0d52937bdeac625df659e11f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.4.0', 'version' => '3.4.0.0', 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.6', 'version' => '6.4.6.0', 'reference' => '9919b5509ada52cc7f66f9a35c86a4a29955c9d3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.0', 'version' => '6.4.0.0', 'reference' => '11d736e97f116ac375a81f96e662911a34cd50ce', '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.29.0', 'version' => '1.29.0.0', 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.4', 'version' => '6.4.4.0', 'reference' => '710e27879e9be3395de2b98da3f52a946039f297', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.4.2', 'version' => '3.4.2.0', 'reference' => '11bbf19a0fb7b36345861e85c5768844c552906e', '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' => 'v6.4.3', 'version' => '6.4.3.0', 'reference' => 'd75715985f0f94f978e3a8fa42533e10db921b90', '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/rector/extension-installer/src/GeneratedConfig.php b/vendor/rector/extension-installer/src/GeneratedConfig.php index 65b40dfcbba..c92c485a828 100644 --- a/vendor/rector/extension-installer/src/GeneratedConfig.php +++ b/vendor/rector/extension-installer/src/GeneratedConfig.php @@ -9,7 +9,7 @@ namespace Rector\RectorInstaller; */ final class GeneratedConfig { - public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main ea7e844'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 05e44cf'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main e8af39b'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main b8126e8')); + public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main ea7e844'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 05e44cf'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main b9cff12'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main b8126e8')); private function __construct() { } diff --git a/vendor/rector/rector-phpunit/docs/rector_rules_overview.md b/vendor/rector/rector-phpunit/docs/rector_rules_overview.md index d7fdcff6582..e3d9c12e31b 100644 --- a/vendor/rector/rector-phpunit/docs/rector_rules_overview.md +++ b/vendor/rector/rector-phpunit/docs/rector_rules_overview.md @@ -1198,12 +1198,12 @@ Refactor deprecated `withConsecutive()` to `willReturnCallback()` structure - [1, 2], - [3, 4], - ); -+ ->willReturnCallback(function () use ($matcher) { -+ return match ($matcher->numberOfInvocations()) { -+ 1 => [1, 2], -+ 2 => [3, 4] ++ ->willReturnCallback(function ($parameters) use ($matcher) { ++ match ($matcher->numberOfInvocations()) { ++ 1 => self::assertEquals([1, 2], $parameters), ++ 2 => self::assertEquals([3, 4], $parameters), + }; -+ }); ++ }); - $this->userServiceMock->expects(self::exactly(2)) + $matcher = self::exactly(2); @@ -1214,12 +1214,12 @@ Refactor deprecated `withConsecutive()` to `willReturnCallback()` structure - [1, 2], - [3, 4], - ); -+ ->willReturnCallback(function () use ($matcher) { -+ return match ($matcher->numberOfInvocations()) { -+ 1 => [1, 2], -+ 2 => [3, 4] -+ }; -+ }); ++ ->willReturnCallback(function ($parameters) use ($matcher) { ++ match ($matcher->numberOfInvocations()) { ++ 1 => self::assertEquals([1, 2], $parameters), ++ 2 => self::assertEquals([3, 4], $parameters), ++ } ++ }); } } ``` diff --git a/vendor/rector/rector-phpunit/src/Rector/StmtsAwareInterface/WithConsecutiveRector.php b/vendor/rector/rector-phpunit/src/Rector/StmtsAwareInterface/WithConsecutiveRector.php index 70c98d3e65a..fbf0ad97be7 100644 --- a/vendor/rector/rector-phpunit/src/Rector/StmtsAwareInterface/WithConsecutiveRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/StmtsAwareInterface/WithConsecutiveRector.php @@ -3,8 +3,10 @@ declare (strict_types=1); namespace Rector\PHPUnit\Rector\StmtsAwareInterface; +use PhpParser\BuilderFactory; use PhpParser\Node; use PhpParser\Node\Arg; +use PhpParser\Node\Expr\ArrayDimFetch; use PhpParser\Node\Expr\Assign; use PhpParser\Node\Expr\Closure; use PhpParser\Node\Expr\ClosureUse; @@ -14,11 +16,13 @@ use PhpParser\Node\Expr\StaticCall; use PhpParser\Node\Expr\Variable; use PhpParser\Node\Identifier; use PhpParser\Node\MatchArm; +use PhpParser\Node\Param; use PhpParser\Node\Scalar\LNumber; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\Expression; use PhpParser\Node\Stmt\Function_; use PhpParser\Node\Stmt\Return_; +use PhpParser\Node\Stmt\Throw_; use PhpParser\NodeTraverser; use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser; use Rector\PhpParser\Node\BetterNodeFinder; @@ -48,11 +52,17 @@ final class WithConsecutiveRector extends AbstractRector implements MinPhpVersio * @var \Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser */ private $simpleCallableNodeTraverser; - public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, BetterNodeFinder $betterNodeFinder, SimpleCallableNodeTraverser $simpleCallableNodeTraverser) + /** + * @readonly + * @var \PhpParser\BuilderFactory + */ + private $builderFactory; + public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, BetterNodeFinder $betterNodeFinder, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, BuilderFactory $builderFactory) { $this->testsNodeAnalyzer = $testsNodeAnalyzer; $this->betterNodeFinder = $betterNodeFinder; $this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser; + $this->builderFactory = $builderFactory; } public function getRuleDefinition() : RuleDefinition { @@ -90,23 +100,23 @@ final class SomeTest extends TestCase $this->personServiceMock->expects($matcher) ->method('prepare') - ->willReturnCallback(function () use ($matcher) { - return match ($matcher->numberOfInvocations()) { - 1 => [1, 2], - 2 => [3, 4] + ->willReturnCallback(function ($parameters) use ($matcher) { + match ($matcher->numberOfInvocations()) { + 1 => self::assertEquals([1, 2], $parameters), + 2 => self::assertEquals([3, 4], $parameters), }; - }); + }); $matcher = self::exactly(2); $this->userServiceMock->expects($matcher) ->method('prepare') - ->willReturnCallback(function () use ($matcher) { - return match ($matcher->numberOfInvocations()) { - 1 => [1, 2], - 2 => [3, 4] - }; - }); + ->willReturnCallback(function ($parameters) use ($matcher) { + match ($matcher->numberOfInvocations()) { + 1 => self::assertEquals([1, 2], $parameters), + 2 => self::assertEquals([3, 4], $parameters), + } + }); } } CODE_SAMPLE @@ -127,17 +137,100 @@ CODE_SAMPLE if (!$this->testsNodeAnalyzer->isInTestClass($node)) { return null; } - $withConsecutiveMethodCall = $this->findWithConsecutiveMethodCall($node); + $withConsecutiveMethodCall = $this->findMethodCall($node, 'withConsecutive'); if (!$withConsecutiveMethodCall instanceof MethodCall) { return null; } + if ($this->hasWillReturnMapOrWill($node)) { + return null; + } + $returnStmts = []; + $willReturn = $this->findMethodCall($node, 'willReturn'); + if ($willReturn instanceof MethodCall) { + $args = $willReturn->getArgs(); + if (\count($args) !== 1 || !$args[0] instanceof Arg) { + return null; + } + $returnStmts = [new Return_($args[0]->value)]; + } + $willReturnSelf = $this->findMethodCall($node, 'willReturnSelf'); + if ($willReturnSelf instanceof MethodCall) { + if ($returnStmts !== []) { + return null; + } + $selfVariable = $willReturnSelf; + while (\true) { + if (!$selfVariable instanceof MethodCall) { + break; + } + $selfVariable = $selfVariable->var; + } + $returnStmts = [new Return_($selfVariable)]; + } + $willReturnArgument = $this->findMethodCall($node, 'willReturnArgument'); + if ($willReturnArgument instanceof MethodCall) { + if ($returnStmts !== []) { + return null; + } + $parametersVariable = new Variable('parameters'); + $args = $willReturnArgument->getArgs(); + if (\count($args) !== 1 || !$args[0] instanceof Arg) { + return null; + } + $returnStmts = [new Return_(new ArrayDimFetch($parametersVariable, $args[0]->value))]; + } + $willReturnOnConsecutiveCallsArgument = $this->findMethodCall($node, 'willReturnOnConsecutiveCalls'); + if ($willReturnOnConsecutiveCallsArgument instanceof MethodCall) { + if ($returnStmts !== []) { + return null; + } + $matcherVariable = new Variable('matcher'); + $numberOfInvocationsMethodCall = new MethodCall($matcherVariable, new Identifier('numberOfInvocations')); + $matchArms = []; + foreach ($willReturnOnConsecutiveCallsArgument->getArgs() as $key => $arg) { + $matchArms[] = new MatchArm([new LNumber($key + 1)], $arg->value); + } + $returnStmts = [new Return_(new Match_($numberOfInvocationsMethodCall, $matchArms))]; + } + $willReturnReferenceArgument = $this->findMethodCall($node, 'willReturnReference'); + $referenceVariable = null; + if ($willReturnReferenceArgument instanceof MethodCall) { + if ($returnStmts !== []) { + return null; + } + $args = $willReturnReferenceArgument->args; + if (\count($args) !== 1 || !$args[0] instanceof Arg) { + return null; + } + $referenceVariable = $args[0]->value; + if (!$referenceVariable instanceof Variable) { + return null; + } + $returnStmts = [new Return_($referenceVariable)]; + } + $willThrowException = $this->findMethodCall($node, 'willThrowException'); + if ($willThrowException instanceof MethodCall) { + if ($returnStmts !== []) { + return null; + } + $args = $willThrowException->getArgs(); + if (\count($args) !== 1 || !$args[0] instanceof Arg) { + return null; + } + $returnStmts = [new Throw_($args[0]->value)]; + } + /** + * remove willReturn, willReturnArgument, willReturnOnConsecutiveCalls, willReturnReference + * willReturnSelf and willThrowException + */ + $this->removeWills($node); $expectsCall = $this->matchAndRefactorExpectsMethodCall($node); if (!$expectsCall instanceof MethodCall && !$expectsCall instanceof StaticCall) { return null; } // 2. rename and replace withConsecutive() $withConsecutiveMethodCall->name = new Identifier('willReturnCallback'); - $withConsecutiveMethodCall->args = [new Arg($this->createClosure($withConsecutiveMethodCall))]; + $withConsecutiveMethodCall->args = [new Arg($this->createClosure($withConsecutiveMethodCall, $returnStmts, $referenceVariable))]; $matcherAssign = new Assign(new Variable('matcher'), $expectsCall); return [new Expression($matcherAssign), $node]; } @@ -173,17 +266,28 @@ CODE_SAMPLE }); return $foundNodes; } - private function createClosure(MethodCall $expectsMethodCall) : Closure + /** + * @param Node\Stmt[] $returnStmts + */ + private function createClosure(MethodCall $expectsMethodCall, array $returnStmts, ?Variable $referenceVariable) : Closure { $closure = new Closure(); + $byRef = $referenceVariable instanceof Variable; + $closure->byRef = $byRef; $matcherVariable = new Variable('matcher'); $closure->uses[] = new ClosureUse($matcherVariable); - $usedVariables = $this->resolveUniqueUsedVariables($expectsMethodCall); + $usedVariables = $this->resolveUniqueUsedVariables(\array_merge($expectsMethodCall->getArgs(), $this->resolveUniqueUsedVariables($returnStmts))); foreach ($usedVariables as $usedVariable) { - $closure->uses[] = new ClosureUse($usedVariable); + $closureUse = new ClosureUse($usedVariable); + if ($byRef && $this->getName($usedVariable) === $this->getName($referenceVariable)) { + $closureUse->byRef = \true; + } + $closure->uses[] = $closureUse; } - $match = $this->createMatch($matcherVariable, $expectsMethodCall); - $closure->stmts[] = new Return_($match); + $parametersVariable = new Variable('parameters'); + $match = $this->createMatch($matcherVariable, $expectsMethodCall, $parametersVariable); + $closure->params[] = new Param($parametersVariable); + $closure->stmts = \array_merge([new Expression($match)], $returnStmts); return $closure; } /** @@ -213,39 +317,41 @@ CODE_SAMPLE }); return $exactlyCall; } - private function findWithConsecutiveMethodCall(Expression $expression) : ?MethodCall + private function findMethodCall(Expression $expression, string $methodName) : ?MethodCall { if (!$expression->expr instanceof MethodCall) { return null; } - /** @var MethodCall|null $withConsecutiveMethodCall */ - $withConsecutiveMethodCall = $this->betterNodeFinder->findFirst($expression->expr, function (Node $node) : bool { + /** @var MethodCall|null $methodCall */ + $methodCall = $this->betterNodeFinder->findFirst($expression->expr, function (Node $node) use($methodName) : bool { if (!$node instanceof MethodCall) { return \false; } - return $this->isName($node->name, 'withConsecutive'); + return $this->isName($node->name, $methodName); }); - return $withConsecutiveMethodCall; + return $methodCall; } - private function createMatch(Variable $matcherVariable, MethodCall $expectsMethodCall) : Match_ + private function createMatch(Variable $matcherVariable, MethodCall $expectsMethodCall, Variable $parameters) : Match_ { $numberOfInvocationsMethodCall = new MethodCall($matcherVariable, new Identifier('numberOfInvocations')); $matchArms = []; foreach ($expectsMethodCall->getArgs() as $key => $arg) { - $matchArms[] = new MatchArm([new LNumber($key + 1)], $arg->value); + $assertEquals = $this->builderFactory->staticCall('self', 'assertEquals', [$arg, $parameters]); + $matchArms[] = new MatchArm([new LNumber($key + 1)], $assertEquals); } return new Match_($numberOfInvocationsMethodCall, $matchArms); } /** + * @param Node[] $nodes * @return Variable[] */ - private function resolveUniqueUsedVariables(MethodCall $expectsMethodCall) : array + private function resolveUniqueUsedVariables(array $nodes) : array { /** @var Variable[] $usedVariables */ - $usedVariables = $this->findInstancesOfScoped($expectsMethodCall->getArgs(), Variable::class); + $usedVariables = $this->findInstancesOfScoped($nodes, Variable::class); $uniqueUsedVariables = []; foreach ($usedVariables as $usedVariable) { - if ($this->isName($usedVariable, 'this')) { + if ($this->isNames($usedVariable, ['this', 'matcher', 'parameters'])) { continue; } $usedVariableName = $this->getName($usedVariable); @@ -253,4 +359,32 @@ CODE_SAMPLE } return $uniqueUsedVariables; } + /** + * @param \PhpParser\Node\Stmt\Expression|\PhpParser\Node $node + */ + private function hasWillReturnMapOrWill($node) : bool + { + $nodesWithWillReturnMap = $this->betterNodeFinder->find($node, function (Node $node) : bool { + if (!$node instanceof MethodCall) { + return \false; + } + return $this->isNames($node->name, ['willReturnMap', 'will']); + }); + return $nodesWithWillReturnMap !== []; + } + /** + * @param \PhpParser\Node\Stmt\Expression|\PhpParser\Node $expression + */ + private function removeWills($expression) : void + { + $this->traverseNodesWithCallable($expression, function (Node $node) : ?Node { + if (!$node instanceof MethodCall) { + return null; + } + if (!$this->isNames($node->name, ['willReturn', 'willReturnArgument', 'willReturnSelf', 'willReturnOnConsecutiveCalls', 'willReturnReference', 'willThrowException'])) { + return null; + } + return $node->var; + }); + } }