From 8a3c738dcd48a2826856e99bec705b6517e54e3d Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 10 Sep 2023 03:16:33 +0000 Subject: [PATCH] Updated Rector to commit 7433ffeb07507632659635152b35af66320d1e07 https://github.com/rectorphp/rector-src/commit/7433ffeb07507632659635152b35af66320d1e07 [Printer] Reduce regex for end with \n detection on BetterStandardPrinter (#4957) --- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 ++--- vendor/composer/autoload_static.php | 8 ++-- vendor/composer/installed.json | 8 ++-- vendor/composer/installed.php | 2 +- .../src/GeneratedConfig.php | 2 +- vendor/rector/rector-phpunit/rector.php | 1 + .../TestWithAnnotationToAttributeRector.php | 3 -- .../TicketAnnotationToAttributeRector.php | 2 - .../RemoveEmptyTestMethodRector.php | 2 +- ...stAnnotationWithPrefixedFunctionRector.php | 2 +- ...structClassMethodToSetUpTestCaseRector.php | 45 ++++++++++++++++++- .../Class_/PreferPHPUnitThisCallRector.php | 2 +- .../AssertTrueFalseToSpecificMethodRector.php | 9 +++- .../Rector/Class_/AddProphecyTraitRector.php | 1 - ...etMockBuilderGetMockToCreateMockRector.php | 1 - .../RemoveDataProviderTestPrefixRector.php | 2 +- .../src/NodeAnalyzer/AssertCallAnalyzer.php | 27 ++++++----- .../src/NodeAnalyzer/TestsNodeAnalyzer.php | 2 +- 19 files changed, 90 insertions(+), 41 deletions(-) diff --git a/vendor/autoload.php b/vendor/autoload.php index 92c3759c5de..76c6aea87f7 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitb7a2a13fd9b0c6bc282aa539d784649d::getLoader(); +return ComposerAutoloaderInitfbe60bacb74a262cac6f1ce20f958bdb::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index c197f89165b..7dbff94e6fd 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitb7a2a13fd9b0c6bc282aa539d784649d +class ComposerAutoloaderInitfbe60bacb74a262cac6f1ce20f958bdb { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInitb7a2a13fd9b0c6bc282aa539d784649d return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitb7a2a13fd9b0c6bc282aa539d784649d', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitfbe60bacb74a262cac6f1ce20f958bdb', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitb7a2a13fd9b0c6bc282aa539d784649d', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitfbe60bacb74a262cac6f1ce20f958bdb', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitb7a2a13fd9b0c6bc282aa539d784649d::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitfbe60bacb74a262cac6f1ce20f958bdb::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitb7a2a13fd9b0c6bc282aa539d784649d::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitfbe60bacb74a262cac6f1ce20f958bdb::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a4be441c305..0bfd2c80b82 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitb7a2a13fd9b0c6bc282aa539d784649d +class ComposerStaticInitfbe60bacb74a262cac6f1ce20f958bdb { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -2599,9 +2599,9 @@ class ComposerStaticInitb7a2a13fd9b0c6bc282aa539d784649d public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitb7a2a13fd9b0c6bc282aa539d784649d::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitb7a2a13fd9b0c6bc282aa539d784649d::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitb7a2a13fd9b0c6bc282aa539d784649d::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitfbe60bacb74a262cac6f1ce20f958bdb::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitfbe60bacb74a262cac6f1ce20f958bdb::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitfbe60bacb74a262cac6f1ce20f958bdb::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 31c79701af2..e55f0641a98 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1872,12 +1872,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git", - "reference": "2800f5c374cffc20cbdfb221ce033b46a3a8003d" + "reference": "fde1cef6981bd2b43bc97ac30a9edb922ab2a620" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/2800f5c374cffc20cbdfb221ce033b46a3a8003d", - "reference": "2800f5c374cffc20cbdfb221ce033b46a3a8003d", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/fde1cef6981bd2b43bc97ac30a9edb922ab2a620", + "reference": "fde1cef6981bd2b43bc97ac30a9edb922ab2a620", "shasum": "" }, "require": { @@ -1907,7 +1907,7 @@ "tomasvotruba\/unused-public": "^0.3", "tracy\/tracy": "^2.10" }, - "time": "2023-09-10T01:16:20+00:00", + "time": "2023-09-10T03:12:22+00:00", "default-branch": true, "type": "rector-extension", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index df993de224c..26c32ce4b03 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202309; -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.0', 'version' => '3.1.0.0', 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', '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.3', 'version' => '3.0.3.0', 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.8', 'version' => '2.0.8.0', 'reference' => 'f9301a5b2fb1216b2b08f02ba04dc45423db6bff', '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' => '0.5.1', 'version' => '0.5.1.0', 'reference' => 'b58e5a3933e541dc286cc91fc4f3898bbc6f1623', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.22.0', 'version' => '10.22.0.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.22.0', 'version' => '10.22.0.0', 'reference' => 'eb1a7e72e159136a832f2c0467de5570bdc208ae', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.10', 'version' => '3.2.10.0', 'reference' => 'a4175c62652f2300c8017fb7e640f9ccb11648d2', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.17.1', 'version' => '4.17.1.0', 'reference' => 'a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.1.0', 'version' => '4.1.0.0', 'reference' => '8a4b664e916df82ff26a44709942dfd593fa6f30', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.24.0', 'version' => '1.24.0.0', 'reference' => '3510b0a6274cc42f7219367cb3abfc123ffa09d6', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.10.33', 'version' => '1.10.33.0', 'reference' => '03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), '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.11.0', 'version' => '1.11.0.0', 'reference' => '3be0fc8f1eb37d6875cd6f0c6c7d0be81435de9f', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '6e7e587714fff7a83dcc7025aee42ab3b265ae05', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v2.10.0', 'version' => '2.10.0.0', 'reference' => 'f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.14.0', 'version' => '1.14.0.0', 'reference' => '21591111d3ea62e31f2254280ca0656bc2b1bda6', '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' => 'aecc9c7a9d56870a3e3c59d81261e4cf32191f76', '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' => 'fa41cc710a086d98e3e5b908ce3d5484faa621df', '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' => '2800f5c374cffc20cbdfb221ce033b46a3a8003d', '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' => 'd4f8c9dd6750fe31362d2f93412ed53bd0ff726c', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.0.3', 'version' => '5.0.3.0', 'reference' => '912dc2fbe3e3c1e7873313cc801b100b6c68c87b', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.3.4', 'version' => '6.3.4.0', 'reference' => 'eca495f2ee845130855ddf1cf18460c38966c8b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/filesystem' => array('pretty_version' => 'v6.3.1', 'version' => '6.3.1.0', 'reference' => 'edd36776956f2a6fcf577edb5b05eb0e3bdc52ae', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.3.3', 'version' => '6.3.3.0', 'reference' => '9915db259f67d21eefee768c1abcf1cc61b1fc9e', '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.28.0', 'version' => '1.28.0.0', 'reference' => '42292d99c55abe617799667f454222c54c60e229', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.3.4', 'version' => '6.3.4.0', 'reference' => '0b5c29118f2e980d455d2e34a5659f4579847c54', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.3.0', 'version' => '3.3.0.0', 'reference' => '40da9cc13ec349d9e4966ce18b5fbcd724ab10a4', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symplify/easy-parallel' => array('pretty_version' => '11.1.27', 'version' => '11.1.27.0', 'reference' => '28911142f6a0f4127271f745e2403bb84fcd2b87', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.26', 'version' => '11.1.26.0', 'reference' => '3e66b3fec678b74a076395ec629d535fb95293b5', '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.0', 'version' => '3.1.0.0', 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', '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.3', 'version' => '3.0.3.0', 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.8', 'version' => '2.0.8.0', 'reference' => 'f9301a5b2fb1216b2b08f02ba04dc45423db6bff', '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' => '0.5.1', 'version' => '0.5.1.0', 'reference' => 'b58e5a3933e541dc286cc91fc4f3898bbc6f1623', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.22.0', 'version' => '10.22.0.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.22.0', 'version' => '10.22.0.0', 'reference' => 'eb1a7e72e159136a832f2c0467de5570bdc208ae', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.10', 'version' => '3.2.10.0', 'reference' => 'a4175c62652f2300c8017fb7e640f9ccb11648d2', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.17.1', 'version' => '4.17.1.0', 'reference' => 'a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.1.0', 'version' => '4.1.0.0', 'reference' => '8a4b664e916df82ff26a44709942dfd593fa6f30', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.24.0', 'version' => '1.24.0.0', 'reference' => '3510b0a6274cc42f7219367cb3abfc123ffa09d6', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.10.33', 'version' => '1.10.33.0', 'reference' => '03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), '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.11.0', 'version' => '1.11.0.0', 'reference' => '3be0fc8f1eb37d6875cd6f0c6c7d0be81435de9f', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '6e7e587714fff7a83dcc7025aee42ab3b265ae05', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v2.10.0', 'version' => '2.10.0.0', 'reference' => 'f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.14.0', 'version' => '1.14.0.0', 'reference' => '21591111d3ea62e31f2254280ca0656bc2b1bda6', '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' => 'aecc9c7a9d56870a3e3c59d81261e4cf32191f76', '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' => 'fa41cc710a086d98e3e5b908ce3d5484faa621df', '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' => 'fde1cef6981bd2b43bc97ac30a9edb922ab2a620', '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' => 'd4f8c9dd6750fe31362d2f93412ed53bd0ff726c', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.0.3', 'version' => '5.0.3.0', 'reference' => '912dc2fbe3e3c1e7873313cc801b100b6c68c87b', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.3.4', 'version' => '6.3.4.0', 'reference' => 'eca495f2ee845130855ddf1cf18460c38966c8b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/filesystem' => array('pretty_version' => 'v6.3.1', 'version' => '6.3.1.0', 'reference' => 'edd36776956f2a6fcf577edb5b05eb0e3bdc52ae', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.3.3', 'version' => '6.3.3.0', 'reference' => '9915db259f67d21eefee768c1abcf1cc61b1fc9e', '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.28.0', 'version' => '1.28.0.0', 'reference' => '42292d99c55abe617799667f454222c54c60e229', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.3.4', 'version' => '6.3.4.0', 'reference' => '0b5c29118f2e980d455d2e34a5659f4579847c54', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.3.0', 'version' => '3.3.0.0', 'reference' => '40da9cc13ec349d9e4966ce18b5fbcd724ab10a4', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symplify/easy-parallel' => array('pretty_version' => '11.1.27', 'version' => '11.1.27.0', 'reference' => '28911142f6a0f4127271f745e2403bb84fcd2b87', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.26', 'version' => '11.1.26.0', 'reference' => '3e66b3fec678b74a076395ec629d535fb95293b5', '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 f9836e06ebd..623c7f2d884 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/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main aecc9c7'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main fa41cc7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 2800f5c'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main d4f8c9d')); + public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main aecc9c7'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main fa41cc7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main fde1cef'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main d4f8c9d')); private function __construct() { } diff --git a/vendor/rector/rector-phpunit/rector.php b/vendor/rector/rector-phpunit/rector.php index e82d8e34c1f..c2b06b10c53 100644 --- a/vendor/rector/rector-phpunit/rector.php +++ b/vendor/rector/rector-phpunit/rector.php @@ -10,6 +10,7 @@ use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig) : void { $rectorConfig->importNames(); + $rectorConfig->removeUnusedImports(); $rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/rules', __DIR__ . '/rules-tests']); $rectorConfig->skip([ // for tests diff --git a/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/ClassMethod/TestWithAnnotationToAttributeRector.php b/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/ClassMethod/TestWithAnnotationToAttributeRector.php index e68d7e2f636..bf0cfdd4171 100644 --- a/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/ClassMethod/TestWithAnnotationToAttributeRector.php +++ b/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/ClassMethod/TestWithAnnotationToAttributeRector.php @@ -5,9 +5,6 @@ namespace Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod; use RectorPrefix202309\Nette\Utils\Json; use PhpParser\Node; -use PhpParser\Node\Attribute; -use PhpParser\Node\AttributeGroup; -use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Stmt\ClassMethod; use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; diff --git a/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/Class_/TicketAnnotationToAttributeRector.php b/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/Class_/TicketAnnotationToAttributeRector.php index 63fd1d38c1f..2f63cae674a 100644 --- a/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/Class_/TicketAnnotationToAttributeRector.php +++ b/vendor/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/Class_/TicketAnnotationToAttributeRector.php @@ -16,10 +16,8 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; use RectorPrefix202309\PHPUnit\Framework\Attributes\Ticket; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo; use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover; -use Rector\Core\Contract\Rector\ConfigurableRectorInterface; use Rector\Core\Rector\AbstractRector; use Rector\Core\ValueObject\PhpVersionFeature; -use Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory; use Rector\PHPUnit\ValueObject\AnnotationWithValueToAttribute; use Rector\VersionBonding\Contract\MinPhpVersionInterface; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; diff --git a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/RemoveEmptyTestMethodRector.php b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/RemoveEmptyTestMethodRector.php index 42316eb98e6..b828f95e20e 100644 --- a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/RemoveEmptyTestMethodRector.php +++ b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/RemoveEmptyTestMethodRector.php @@ -61,7 +61,7 @@ CODE_SAMPLE if (!$this->testsNodeAnalyzer->isInTestClass($node)) { return null; } - if (!$this->isName($node->name, 'test*')) { + if (!\fnmatch('test*', $node->name->toString(), \FNM_NOESCAPE)) { return null; } if ($node->stmts === null) { diff --git a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/ReplaceTestAnnotationWithPrefixedFunctionRector.php b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/ReplaceTestAnnotationWithPrefixedFunctionRector.php index 23f1368f432..1f9591ed790 100644 --- a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/ReplaceTestAnnotationWithPrefixedFunctionRector.php +++ b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/ClassMethod/ReplaceTestAnnotationWithPrefixedFunctionRector.php @@ -71,7 +71,7 @@ CODE_SAMPLE if (!$this->testsNodeAnalyzer->isInTestClass($node)) { return null; } - if ($this->isName($node->name, 'test*')) { + if (\fnmatch('test*', $node->name->toString(), \FNM_NOESCAPE)) { return null; } $docComment = $node->getDocComment(); diff --git a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/ConstructClassMethodToSetUpTestCaseRector.php b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/ConstructClassMethodToSetUpTestCaseRector.php index 141bb39c8ca..8a7c36ceb6f 100644 --- a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/ConstructClassMethodToSetUpTestCaseRector.php +++ b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/ConstructClassMethodToSetUpTestCaseRector.php @@ -6,13 +6,17 @@ namespace Rector\PHPUnit\CodeQuality\Rector\Class_; use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Expr\StaticCall; +use PhpParser\Node\Expr\Variable; use PhpParser\Node\Identifier; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Expression; +use PhpParser\NodeTraverser; +use PHPStan\Reflection\ClassReflection; use Rector\Core\NodeAnalyzer\ClassAnalyzer; use Rector\Core\Rector\AbstractRector; +use Rector\Core\Reflection\ReflectionResolver; use Rector\Core\ValueObject\MethodName; use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\PHPUnit\NodeAnalyzer\SetUpMethodDecorator; @@ -47,12 +51,18 @@ final class ConstructClassMethodToSetUpTestCaseRector extends AbstractRector * @var \Rector\PHPUnit\NodeAnalyzer\SetUpMethodDecorator */ private $setUpMethodDecorator; - public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, ClassAnalyzer $classAnalyzer, VisibilityManipulator $visibilityManipulator, SetUpMethodDecorator $setUpMethodDecorator) + /** + * @readonly + * @var \Rector\Core\Reflection\ReflectionResolver + */ + private $reflectionResolver; + public function __construct(TestsNodeAnalyzer $testsNodeAnalyzer, ClassAnalyzer $classAnalyzer, VisibilityManipulator $visibilityManipulator, SetUpMethodDecorator $setUpMethodDecorator, ReflectionResolver $reflectionResolver) { $this->testsNodeAnalyzer = $testsNodeAnalyzer; $this->classAnalyzer = $classAnalyzer; $this->visibilityManipulator = $visibilityManipulator; $this->setUpMethodDecorator = $setUpMethodDecorator; + $this->reflectionResolver = $reflectionResolver; } public function getRuleDefinition() : RuleDefinition { @@ -109,6 +119,9 @@ CODE_SAMPLE if ($this->classAnalyzer->isAnonymousClass($node)) { return null; } + if ($this->shouldSkip($node, $constructClassMethod)) { + return null; + } $addedStmts = $this->resolveStmtsToAddToSetUp($constructClassMethod); $setUpClassMethod = $node->getMethod(MethodName::SET_UP); if (!$setUpClassMethod instanceof ClassMethod) { @@ -125,6 +138,36 @@ CODE_SAMPLE } return $node; } + private function shouldSkip(Class_ $class, ClassMethod $classMethod) : bool + { + $classReflection = $this->reflectionResolver->resolveClassReflection($class); + if (!$classReflection instanceof ClassReflection) { + return \true; + } + $currentParent = \current($classReflection->getParents()); + if (!$currentParent instanceof ClassReflection) { + return \true; + } + if ($currentParent->getName() !== 'PHPUnit\\Framework\\TestCase') { + return \true; + } + $paramNames = []; + foreach ($classMethod->params as $param) { + $paramNames[] = $this->getName($param); + } + $isFoundParamUsed = \false; + $this->traverseNodesWithCallable((array) $classMethod->stmts, function (Node $subNode) use($paramNames, &$isFoundParamUsed) : ?int { + if ($subNode instanceof StaticCall && $this->isName($subNode->name, MethodName::CONSTRUCT)) { + return NodeTraverser::DONT_TRAVERSE_CHILDREN; + } + if ($subNode instanceof Variable && $this->isNames($subNode, $paramNames)) { + $isFoundParamUsed = \true; + return NodeTraverser::STOP_TRAVERSAL; + } + return null; + }); + return $isFoundParamUsed; + } /** * @return Stmt[] */ diff --git a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/PreferPHPUnitThisCallRector.php b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/PreferPHPUnitThisCallRector.php index 27c37cdc8a3..0615666ea7d 100644 --- a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/PreferPHPUnitThisCallRector.php +++ b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Class_/PreferPHPUnitThisCallRector.php @@ -85,7 +85,7 @@ CODE_SAMPLE if (!$this->isNames($node->class, ['static', 'self'])) { return null; } - if (!$this->isName($node->name, 'assert*')) { + if (!\fnmatch('assert*', $methodName, \FNM_NOESCAPE)) { return null; } $hasChanged = \true; diff --git a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php index 57a540c58a3..638ceb60c98 100644 --- a/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php +++ b/vendor/rector/rector-phpunit/rules/CodeQuality/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php @@ -64,7 +64,7 @@ final class AssertTrueFalseToSpecificMethodRector extends AbstractRector if (!$firstArgumentValue instanceof FuncCall && !$firstArgumentValue instanceof Empty_) { return null; } - $firstArgumentName = $this->getName($firstArgumentValue); + $firstArgumentName = $this->resolveFirstArgument($firstArgumentValue); if ($firstArgumentName === null || !\array_key_exists($firstArgumentName, self::FUNCTION_NAME_WITH_ASSERT_METHOD_NAMES)) { return null; } @@ -88,6 +88,13 @@ final class AssertTrueFalseToSpecificMethodRector extends AbstractRector $this->moveFunctionArgumentsUp($node); return $node; } + /** + * @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\Empty_ $firstArgumentValue + */ + private function resolveFirstArgument($firstArgumentValue) : ?string + { + return $firstArgumentValue instanceof Empty_ ? 'empty' : $this->getName($firstArgumentValue); + } /** * @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall $node */ diff --git a/vendor/rector/rector-phpunit/rules/PHPUnit100/Rector/Class_/AddProphecyTraitRector.php b/vendor/rector/rector-phpunit/rules/PHPUnit100/Rector/Class_/AddProphecyTraitRector.php index 52f272e313a..bfc2dd6a0ef 100644 --- a/vendor/rector/rector-phpunit/rules/PHPUnit100/Rector/Class_/AddProphecyTraitRector.php +++ b/vendor/rector/rector-phpunit/rules/PHPUnit100/Rector/Class_/AddProphecyTraitRector.php @@ -8,7 +8,6 @@ use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\TraitUse; use PHPStan\Reflection\ClassReflection; -use Rector\Core\NodeManipulator\ClassManipulator; use Rector\Core\Rector\AbstractRector; use Rector\Core\Reflection\ReflectionResolver; use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer; diff --git a/vendor/rector/rector-phpunit/rules/PHPUnit60/Rector/MethodCall/GetMockBuilderGetMockToCreateMockRector.php b/vendor/rector/rector-phpunit/rules/PHPUnit60/Rector/MethodCall/GetMockBuilderGetMockToCreateMockRector.php index ff5cff002d3..03a79edda4e 100644 --- a/vendor/rector/rector-phpunit/rules/PHPUnit60/Rector/MethodCall/GetMockBuilderGetMockToCreateMockRector.php +++ b/vendor/rector/rector-phpunit/rules/PHPUnit60/Rector/MethodCall/GetMockBuilderGetMockToCreateMockRector.php @@ -6,7 +6,6 @@ namespace Rector\PHPUnit\PHPUnit60\Rector\MethodCall; use PhpParser\Node; use PhpParser\Node\Expr\MethodCall; use PHPStan\Type\ObjectType; -use PHPStan\Type\TypeWithClassName; use Rector\Core\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/vendor/rector/rector-phpunit/rules/PHPUnit70/Rector/Class_/RemoveDataProviderTestPrefixRector.php b/vendor/rector/rector-phpunit/rules/PHPUnit70/Rector/Class_/RemoveDataProviderTestPrefixRector.php index 17f75764f14..c6779b923da 100644 --- a/vendor/rector/rector-phpunit/rules/PHPUnit70/Rector/Class_/RemoveDataProviderTestPrefixRector.php +++ b/vendor/rector/rector-phpunit/rules/PHPUnit70/Rector/Class_/RemoveDataProviderTestPrefixRector.php @@ -97,7 +97,7 @@ CODE_SAMPLE $hasChanged = \false; $dataProviderClassMethods = $this->dataProviderClassMethodFinder->find($node); foreach ($dataProviderClassMethods as $dataProviderClassMethod) { - if (!$this->isName($dataProviderClassMethod, 'test*')) { + if (!\fnmatch('test*', $dataProviderClassMethod->name->toString(), \FNM_NOESCAPE)) { continue; } $shortMethodName = Strings::substring($dataProviderClassMethod->name->toString(), 4); diff --git a/vendor/rector/rector-phpunit/src/NodeAnalyzer/AssertCallAnalyzer.php b/vendor/rector/rector-phpunit/src/NodeAnalyzer/AssertCallAnalyzer.php index 533d60653cf..f693c3882d1 100644 --- a/vendor/rector/rector-phpunit/src/NodeAnalyzer/AssertCallAnalyzer.php +++ b/vendor/rector/rector-phpunit/src/NodeAnalyzer/AssertCallAnalyzer.php @@ -6,6 +6,7 @@ namespace Rector\PHPUnit\NodeAnalyzer; use PhpParser\Node; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Expr\StaticCall; +use PhpParser\Node\Identifier; use PhpParser\Node\Stmt\ClassMethod; use PHPStan\Type\TypeWithClassName; use Rector\Core\PhpParser\AstResolver; @@ -156,16 +157,20 @@ final class AssertCallAnalyzer */ private function isAssertMethodName($call) : bool { - return $this->nodeNameResolver->isNames($call->name, [ - // phpunit - '*assert', - 'assert*', - 'expectException*', - 'setExpectedException*', - 'expectOutput*', - 'should*', - 'doTestFileInfo', - 'expectNotToPerformAssertions', - ]); + if (!$call->name instanceof Identifier) { + return \false; + } + $callname = $call->name->toString(); + foreach (['doTestFileInfo', 'expectNotToPerformAssertions'] as $methodCallName) { + if ($callname === $methodCallName) { + return \true; + } + } + foreach (['*assert', 'assert*', 'expectException*', 'setExpectedException*', 'expectOutput*', 'should*'] as $methodCallNamePattern) { + if (\fnmatch($methodCallNamePattern, $callname, \FNM_NOESCAPE)) { + return \true; + } + } + return \false; } } diff --git a/vendor/rector/rector-phpunit/src/NodeAnalyzer/TestsNodeAnalyzer.php b/vendor/rector/rector-phpunit/src/NodeAnalyzer/TestsNodeAnalyzer.php index 5afdf92eaeb..3a69ab41b12 100644 --- a/vendor/rector/rector-phpunit/src/NodeAnalyzer/TestsNodeAnalyzer.php +++ b/vendor/rector/rector-phpunit/src/NodeAnalyzer/TestsNodeAnalyzer.php @@ -64,7 +64,7 @@ final class TestsNodeAnalyzer if (!$classMethod->isPublic()) { return \false; } - if ($this->nodeNameResolver->isName($classMethod, 'test*')) { + if (\fnmatch('test*', $classMethod->name->toString(), \FNM_NOESCAPE)) { return \true; } $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);