diff --git a/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php b/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php index c294cd5a309..f5653495465 100644 --- a/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php +++ b/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php @@ -337,8 +337,9 @@ final class PHPStanNodeScopeResolver private function resolveClassOrInterfaceScope($classLike, MutatingScope $mutatingScope, bool $isScopeRefreshing) : MutatingScope { $className = $this->resolveClassName($classLike); + $isAnonymous = $this->classAnalyzer->isAnonymousClass($classLike); // is anonymous class? - not possible to enter it since PHPStan 0.12.33, see https://github.com/phpstan/phpstan-src/commit/e87fb0ec26f9c8552bbeef26a868b1e5d8185e91 - if ($classLike instanceof Class_ && $this->classAnalyzer->isAnonymousClass($classLike)) { + if ($classLike instanceof Class_ && $isAnonymous) { $classReflection = $this->reflectionProvider->getAnonymousClassReflection($classLike, $mutatingScope); } elseif (!$this->reflectionProvider->hasClass($className)) { return $mutatingScope; @@ -346,7 +347,7 @@ final class PHPStanNodeScopeResolver $classReflection = $this->reflectionProvider->getClass($className); } // on refresh, remove entered class avoid entering the class again - if ($isScopeRefreshing && $mutatingScope->isInClass() && !$classReflection->isAnonymous()) { + if ($isScopeRefreshing && $mutatingScope->isInClass() && !$isAnonymous) { $context = $this->privatesAccessor->getPrivateProperty($mutatingScope, 'context'); $this->privatesAccessor->setPrivateProperty($context, 'classReflection', null); } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 631ad9e5586..256ac09ad55 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 = 'e6fd26353fa114ac92ba4b0c9b572f508b850e7f'; + public const PACKAGE_VERSION = '376f6cbd4a51290c63a42d77ac9fc9a3a5d0ab67'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-05-09 18:34:12'; + public const RELEASE_DATE = '2023-05-09 19:08:35'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index 9c1bbbea3d7..093648b7cb1 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 ComposerAutoloaderInitb4ca30e2c376abfca468e95676dcf6a8::getLoader(); +return ComposerAutoloaderInit5e0cc74cd5afe070b0f4c42a0e5dbb58::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index f0bb574682d..8be96a89e86 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitb4ca30e2c376abfca468e95676dcf6a8 +class ComposerAutoloaderInit5e0cc74cd5afe070b0f4c42a0e5dbb58 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInitb4ca30e2c376abfca468e95676dcf6a8 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitb4ca30e2c376abfca468e95676dcf6a8', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit5e0cc74cd5afe070b0f4c42a0e5dbb58', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitb4ca30e2c376abfca468e95676dcf6a8', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit5e0cc74cd5afe070b0f4c42a0e5dbb58', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitb4ca30e2c376abfca468e95676dcf6a8::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit5e0cc74cd5afe070b0f4c42a0e5dbb58::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitb4ca30e2c376abfca468e95676dcf6a8::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit5e0cc74cd5afe070b0f4c42a0e5dbb58::$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 8242b563908..fba8409ea58 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitb4ca30e2c376abfca468e95676dcf6a8 +class ComposerStaticInit5e0cc74cd5afe070b0f4c42a0e5dbb58 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3113,9 +3113,9 @@ class ComposerStaticInitb4ca30e2c376abfca468e95676dcf6a8 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitb4ca30e2c376abfca468e95676dcf6a8::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitb4ca30e2c376abfca468e95676dcf6a8::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitb4ca30e2c376abfca468e95676dcf6a8::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit5e0cc74cd5afe070b0f4c42a0e5dbb58::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit5e0cc74cd5afe070b0f4c42a0e5dbb58::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit5e0cc74cd5afe070b0f4c42a0e5dbb58::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 8b239db49fb..100d8938dac 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1991,12 +1991,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git", - "reference": "dc4b405aaa7117ffe0ae44c5535607801ee14aae" + "reference": "63d391e70b0c826346929589a519f0a12ca672fb" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/dc4b405aaa7117ffe0ae44c5535607801ee14aae", - "reference": "dc4b405aaa7117ffe0ae44c5535607801ee14aae", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/63d391e70b0c826346929589a519f0a12ca672fb", + "reference": "63d391e70b0c826346929589a519f0a12ca672fb", "shasum": "" }, "require": { @@ -2025,7 +2025,7 @@ "tomasvotruba\/type-coverage": "^0.0.9", "tomasvotruba\/unused-public": "^0.0.34" }, - "time": "2023-04-17T16:12:29+00:00", + "time": "2023-05-09T18:00:30+00:00", "default-branch": true, "type": "rector-extension", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 112f8e24201..a9f00767c61 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202305; -return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(0 => '0.15.x-dev'), '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.3.2', 'version' => '3.3.2.0', 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', '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.6', 'version' => '2.0.6.0', 'reference' => 'd9d313a36c872fd6ee06d9a6cbcf713eaa40f024', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.1', 'version' => '3.0.1.0', 'reference' => '531bfb9d15f8aa57454f5f0285b18bec903b8fb7', '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), 'nette/neon' => array('pretty_version' => 'v3.4.0', 'version' => '3.4.0.0', 'reference' => '372d945c156ee7f35c953339fb164538339e6283', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/neon', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.9', 'version' => '3.2.9.0', 'reference' => 'c91bac3470c34b2ecd5400f6e6fdf0b64a836a5c', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.15.4', 'version' => '4.15.4.0', 'reference' => '6bb5176bc4af8bcb7d926f88718db9b96a2d4290', '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.20.4', 'version' => '1.20.4.0', 'reference' => '7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.10.15', 'version' => '1.10.15.0', 'reference' => '762c4dac4da6f8756eebb80e528c3a47855da9bd', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'psr/cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', '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/event-dispatcher' => array('pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), 'dev_requirement' => \false), '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')), '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.10.0', 'version' => '1.10.0.0', 'reference' => 'a5427e7dfa47713e438016905605819d101f238c', '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/promise-timer' => array('pretty_version' => 'v1.9.0', 'version' => '1.9.0.0', 'reference' => 'aa7a73c74b8d8c0f622f5982ff7b0351bc29e495', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise-timer', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.12.0', 'version' => '1.12.0.0', 'reference' => '81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => '7a423506ee1903e89f1e08ec5f0ed430ff784ae9', '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 => '0.15.x-dev', 1 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '03df9e339b005534311b732c616a5d0a9e23158a', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '3209c44703d4bef7614048ed2a5019665ec3a9f2', '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' => 'dc4b405aaa7117ffe0ae44c5535607801ee14aae', '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(0 => '0.15.x-dev'), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '7320d80f74951fb36a2b639c443a70d090d0f1a8', '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/cache-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/config' => array('pretty_version' => 'v6.2.7', 'version' => '6.2.7.0', 'reference' => '249271da6f545d6579e0663374f8249a80be2893', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.2.10', 'version' => '6.2.10.0', 'reference' => '12288d9f4500f84a4d02254d4aa968b15488476f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.2.1', 'version' => '3.2.1.0', 'reference' => '8ec95320f72fd012bf6335498c8f6c8d64957346', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.12', 'version' => '6.1.12.0', 'reference' => '360c9d0948e1fe675336346d5862e8e55b378d90', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/filesystem' => array('pretty_version' => 'v6.2.10', 'version' => '6.2.10.0', 'reference' => 'fd588debf7d1bc16a2c84b4b3b71145d9946b894', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.2.7', 'version' => '6.2.7.0', 'reference' => '20808dc6631aecafbe67c186af5dcb370be3a0eb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-normalizer' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.2.10', 'version' => '6.2.10.0', 'reference' => 'b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.2.8', 'version' => '6.2.8.0', 'reference' => '193e83bbd6617d6b2151c37fff10fa7168ebddef', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), '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), 'tracy/tracy' => array('pretty_version' => 'v2.10.2', 'version' => '2.10.2.0', 'reference' => '882fee7cf4258a602ad4a37461e837ed2ca1406b', 'type' => 'library', 'install_path' => __DIR__ . '/../tracy/tracy', '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(0 => '0.15.x-dev'), '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.3.2', 'version' => '3.3.2.0', 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', '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.6', 'version' => '2.0.6.0', 'reference' => 'd9d313a36c872fd6ee06d9a6cbcf713eaa40f024', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.1', 'version' => '3.0.1.0', 'reference' => '531bfb9d15f8aa57454f5f0285b18bec903b8fb7', '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), 'nette/neon' => array('pretty_version' => 'v3.4.0', 'version' => '3.4.0.0', 'reference' => '372d945c156ee7f35c953339fb164538339e6283', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/neon', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.9', 'version' => '3.2.9.0', 'reference' => 'c91bac3470c34b2ecd5400f6e6fdf0b64a836a5c', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.15.4', 'version' => '4.15.4.0', 'reference' => '6bb5176bc4af8bcb7d926f88718db9b96a2d4290', '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.20.4', 'version' => '1.20.4.0', 'reference' => '7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.10.15', 'version' => '1.10.15.0', 'reference' => '762c4dac4da6f8756eebb80e528c3a47855da9bd', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'psr/cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', '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/event-dispatcher' => array('pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), 'dev_requirement' => \false), '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')), '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.10.0', 'version' => '1.10.0.0', 'reference' => 'a5427e7dfa47713e438016905605819d101f238c', '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/promise-timer' => array('pretty_version' => 'v1.9.0', 'version' => '1.9.0.0', 'reference' => 'aa7a73c74b8d8c0f622f5982ff7b0351bc29e495', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise-timer', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.12.0', 'version' => '1.12.0.0', 'reference' => '81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => '7a423506ee1903e89f1e08ec5f0ed430ff784ae9', '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 => '0.15.x-dev', 1 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '03df9e339b005534311b732c616a5d0a9e23158a', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '3209c44703d4bef7614048ed2a5019665ec3a9f2', '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' => '63d391e70b0c826346929589a519f0a12ca672fb', '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(0 => '0.15.x-dev'), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '7320d80f74951fb36a2b639c443a70d090d0f1a8', '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/cache-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/config' => array('pretty_version' => 'v6.2.7', 'version' => '6.2.7.0', 'reference' => '249271da6f545d6579e0663374f8249a80be2893', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.2.10', 'version' => '6.2.10.0', 'reference' => '12288d9f4500f84a4d02254d4aa968b15488476f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.2.1', 'version' => '3.2.1.0', 'reference' => '8ec95320f72fd012bf6335498c8f6c8d64957346', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.12', 'version' => '6.1.12.0', 'reference' => '360c9d0948e1fe675336346d5862e8e55b378d90', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/filesystem' => array('pretty_version' => 'v6.2.10', 'version' => '6.2.10.0', 'reference' => 'fd588debf7d1bc16a2c84b4b3b71145d9946b894', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.2.7', 'version' => '6.2.7.0', 'reference' => '20808dc6631aecafbe67c186af5dcb370be3a0eb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-normalizer' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.2.10', 'version' => '6.2.10.0', 'reference' => 'b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.2.8', 'version' => '6.2.8.0', 'reference' => '193e83bbd6617d6b2151c37fff10fa7168ebddef', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.1')), '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), 'tracy/tracy' => array('pretty_version' => 'v2.10.2', 'version' => '2.10.2.0', 'reference' => '882fee7cf4258a602ad4a37461e837ed2ca1406b', 'type' => 'library', 'install_path' => __DIR__ . '/../tracy/tracy', '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 fcb3bf36a20..491017970d6 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' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 03df9e3'), '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' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3209c44'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main dc4b405'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 7320d80')); + 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' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 03df9e3'), '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' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3209c44'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 63d391e'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 7320d80')); private function __construct() { } diff --git a/vendor/rector/rector-phpunit/src/NodeFactory/ArgumentShiftingFactory.php b/vendor/rector/rector-phpunit/src/NodeFactory/ArgumentShiftingFactory.php index 0632ed89b95..04bed1ccbba 100644 --- a/vendor/rector/rector-phpunit/src/NodeFactory/ArgumentShiftingFactory.php +++ b/vendor/rector/rector-phpunit/src/NodeFactory/ArgumentShiftingFactory.php @@ -10,7 +10,7 @@ final class ArgumentShiftingFactory public function removeAllButFirstArgMethodCall(MethodCall $methodCall, string $methodName) : void { $methodCall->name = new Identifier($methodName); - foreach (\array_keys($methodCall->args) as $i) { + foreach (\array_keys($methodCall->getArgs()) as $i) { // keep first arg if ($i === 0) { continue; diff --git a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionCodeFactory.php b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionCodeFactory.php index 05d7412411b..b049379712c 100644 --- a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionCodeFactory.php +++ b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionCodeFactory.php @@ -35,7 +35,7 @@ final class ExpectExceptionCodeFactory if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($methodCall, ['assertSame', 'assertEquals'])) { return null; } - $secondArgument = $methodCall->args[1]->value; + $secondArgument = $methodCall->getArgs()[1]->value; if (!$secondArgument instanceof MethodCall) { return null; } diff --git a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionFactory.php b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionFactory.php index 8bb7c7f8b48..584cc0780cf 100644 --- a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionFactory.php +++ b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionFactory.php @@ -29,7 +29,7 @@ final class ExpectExceptionFactory if (!$this->testsNodeAnalyzer->isInPHPUnitMethodCallName($methodCall, 'assertInstanceOf')) { return null; } - $argumentVariableName = $this->nodeNameResolver->getName($methodCall->args[1]->value); + $argumentVariableName = $this->nodeNameResolver->getName($methodCall->getArgs()[1]->value); if ($argumentVariableName === null) { return null; } @@ -37,6 +37,6 @@ final class ExpectExceptionFactory if (!$this->nodeNameResolver->isName($variable, $argumentVariableName)) { return null; } - return new MethodCall($methodCall->var, 'expectException', [$methodCall->args[0]]); + return new MethodCall($methodCall->var, 'expectException', [$methodCall->getArgs()[0]]); } } diff --git a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageFactory.php b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageFactory.php index 2ef78ffd7d1..ff2ec257938 100644 --- a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageFactory.php +++ b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageFactory.php @@ -42,7 +42,7 @@ final class ExpectExceptionMessageFactory if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($methodCall, ['assertSame', 'assertEquals'])) { return null; } - $secondArgument = $methodCall->args[1]->value; + $secondArgument = $methodCall->getArgs()[1]->value; if (!$secondArgument instanceof MethodCall) { return null; } diff --git a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageRegExpFactory.php b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageRegExpFactory.php index 98ea2a3466c..58c5b3f71a6 100644 --- a/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageRegExpFactory.php +++ b/vendor/rector/rector-phpunit/src/NodeFactory/ExpectExceptionMessageRegExpFactory.php @@ -43,7 +43,7 @@ final class ExpectExceptionMessageRegExpFactory if (!$this->testsNodeAnalyzer->isInPHPUnitMethodCallName($methodCall, 'assertContains')) { return null; } - $secondArgument = $methodCall->args[1]->value; + $secondArgument = $methodCall->getArgs()[1]->value; if (!$secondArgument instanceof MethodCall) { return null; } @@ -56,10 +56,10 @@ final class ExpectExceptionMessageRegExpFactory } $this->argumentShiftingFactory->removeAllButFirstArgMethodCall($methodCall, 'expectExceptionMessageRegExp'); // put regex between "#...#" to create match - if ($methodCall->args[0]->value instanceof String_) { - /** @var String_ $oldString */ - $oldString = $methodCall->args[0]->value; - $methodCall->args[0]->value = new String_('#' . \preg_quote($oldString->value, '#') . '#'); + $firstArg = $methodCall->getArgs()[0]; + if ($firstArg->value instanceof String_) { + $oldString = $firstArg->value; + $firstArg->value = new String_('#' . \preg_quote($oldString->value, '#') . '#'); } return $methodCall; } diff --git a/vendor/rector/rector-phpunit/src/NodeManipulator/ArgumentMover.php b/vendor/rector/rector-phpunit/src/NodeManipulator/ArgumentMover.php index 4a01a80e75c..04784597306 100644 --- a/vendor/rector/rector-phpunit/src/NodeManipulator/ArgumentMover.php +++ b/vendor/rector/rector-phpunit/src/NodeManipulator/ArgumentMover.php @@ -12,7 +12,7 @@ final class ArgumentMover */ public function removeFirst($node) : void { - $methodArguments = $node->args; + $methodArguments = $node->getArgs(); \array_shift($methodArguments); $node->args = $methodArguments; } diff --git a/vendor/rector/rector-phpunit/src/Rector/Class_/ArrayArgumentToDataProviderRector.php b/vendor/rector/rector-phpunit/src/Rector/Class_/ArrayArgumentToDataProviderRector.php index 79db7d8f85d..cbe9608358b 100644 --- a/vendor/rector/rector-phpunit/src/Rector/Class_/ArrayArgumentToDataProviderRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/Class_/ArrayArgumentToDataProviderRector.php @@ -155,11 +155,11 @@ CODE_SAMPLE if (!$this->isMethodCallMatch($methodCall, $arrayArgumentToDataProvider)) { return; } - if (\count($methodCall->args) !== 1) { + if (\count($methodCall->getArgs()) !== 1) { throw new ShouldNotHappenException(); } // resolve value types - $firstArgumentValue = $methodCall->args[0]->value; + $firstArgumentValue = $methodCall->getArgs()[0]->value; if (!$firstArgumentValue instanceof Array_) { // nothing we can do return; @@ -170,7 +170,7 @@ CODE_SAMPLE if ($dataProviderMethodName === null) { return; } - $this->dataProviderClassMethodRecipes[] = new DataProviderClassMethodRecipe($dataProviderMethodName, $methodCall->args); + $this->dataProviderClassMethodRecipes[] = new DataProviderClassMethodRecipe($dataProviderMethodName, $methodCall->getArgs()); $methodCall->args = []; $paramAndArgs = $this->paramAndArgFromArrayResolver->resolve($firstArgumentValue, $arrayArgumentToDataProvider->getVariableName()); foreach ($paramAndArgs as $paramAndArg) { diff --git a/vendor/rector/rector-phpunit/src/Rector/Foreach_/SimplifyForeachInstanceOfRector.php b/vendor/rector/rector-phpunit/src/Rector/Foreach_/SimplifyForeachInstanceOfRector.php index 00d0c3c7905..e04f31018cd 100644 --- a/vendor/rector/rector-phpunit/src/Rector/Foreach_/SimplifyForeachInstanceOfRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/Foreach_/SimplifyForeachInstanceOfRector.php @@ -7,8 +7,8 @@ use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Expr\StaticCall; +use PhpParser\Node\Stmt\Expression; use PhpParser\Node\Stmt\Foreach_; -use Rector\Core\NodeManipulator\ForeachManipulator; use Rector\Core\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -17,15 +17,6 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; */ final class SimplifyForeachInstanceOfRector extends AbstractRector { - /** - * @readonly - * @var \Rector\Core\NodeManipulator\ForeachManipulator - */ - private $foreachManipulator; - public function __construct(ForeachManipulator $foreachManipulator) - { - $this->foreachManipulator = $foreachManipulator; - } public function getRuleDefinition() : RuleDefinition { return new RuleDefinition('Simplify unnecessary foreach check of instances', [new CodeSample(<<<'CODE_SAMPLE' @@ -50,30 +41,31 @@ CODE_SAMPLE */ public function refactor(Node $node) : ?Node { - /** @var MethodCall|StaticCall|null $matchedNode */ - $matchedNode = $this->foreachManipulator->matchOnlyStmt($node, function (Node $node, Foreach_ $foreach) : ?Node { - if (!$node instanceof MethodCall && !$node instanceof StaticCall) { - return null; - } - if (!$this->isName($node->name, 'assertInstanceOf')) { - return null; - } - if (!$this->nodeComparator->areNodesEqual($foreach->valueVar, $node->args[1]->value)) { - return null; - } - return $node; - }); - if ($matchedNode === null) { + if (\count($node->stmts) !== 1) { + return null; + } + $onlyStmt = $node->stmts[0]; + if (!$onlyStmt instanceof Expression) { + return null; + } + $expr = $onlyStmt->expr; + if (!$expr instanceof MethodCall && !$expr instanceof StaticCall) { + return null; + } + if (!$this->isName($expr->name, 'assertInstanceOf')) { + return null; + } + if (!$this->nodeComparator->areNodesEqual($node->valueVar, $expr->getArgs()[1]->value)) { return null; } // skip if there is a custom message included; it might be per item - if (\count($matchedNode->getArgs()) === 3) { + if (\count($expr->getArgs()) === 3) { return null; } - $args = [$matchedNode->args[0], new Arg($node->expr)]; - if ($matchedNode instanceof StaticCall) { - return new StaticCall($matchedNode->class, 'assertContainsOnlyInstancesOf', $args); + $newArgs = [$expr->getArgs()[0], new Arg($node->expr)]; + if ($expr instanceof StaticCall) { + return new StaticCall($expr->class, 'assertContainsOnlyInstancesOf', $newArgs); } - return new MethodCall($matchedNode->var, 'assertContainsOnlyInstancesOf', $args); + return new MethodCall($expr->var, 'assertContainsOnlyInstancesOf', $newArgs); } } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertCompareToSpecificMethodRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertCompareToSpecificMethodRector.php index a5657bb6896..3b6e00afb1b 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertCompareToSpecificMethodRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertCompareToSpecificMethodRector.php @@ -64,8 +64,8 @@ final class AssertCompareToSpecificMethodRector extends AbstractRector if (!isset($node->args[1])) { return null; } - $firstArgument = $node->args[0]; - $secondArgument = $node->args[1]; + $firstArgument = $node->getArgs()[0]; + $secondArgument = $node->getArgs()[1]; $firstArgumentValue = $firstArgument->value; $secondArgumentValue = $secondArgument->value; if ($secondArgumentValue instanceof FuncCall) { @@ -109,7 +109,7 @@ final class AssertCompareToSpecificMethodRector extends AbstractRector */ private function moveFunctionArgumentsUp($node, FuncCall $funcCall, Arg $requiredArg) : void { - $node->args[1] = $funcCall->args[0]; + $node->args[1] = $funcCall->getArgs()[0]; $node->args[0] = $requiredArg; } } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertComparisonToSpecificMethodRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertComparisonToSpecificMethodRector.php index c963400fa79..c96672ad945 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertComparisonToSpecificMethodRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertComparisonToSpecificMethodRector.php @@ -69,7 +69,7 @@ final class AssertComparisonToSpecificMethodRector extends AbstractRector if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, ['assertTrue', 'assertFalse'])) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if (!$firstArgumentValue instanceof BinaryOp) { return null; } @@ -96,7 +96,7 @@ final class AssertComparisonToSpecificMethodRector extends AbstractRector */ private function changeArgumentsOrder($node) : void { - $oldArguments = $node->args; + $oldArguments = $node->getArgs(); /** @var BinaryOp $expression */ $expression = $oldArguments[0]->value; if ($this->isConstantValue($expression->left)) { diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertEqualsParameterToSpecificMethodsTypeRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertEqualsParameterToSpecificMethodsTypeRector.php index 4c8224b0a3c..5f717af3ca3 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertEqualsParameterToSpecificMethodsTypeRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertEqualsParameterToSpecificMethodsTypeRector.php @@ -117,8 +117,8 @@ CODE_SAMPLE return $call; } $newMethodCall = $this->assertCallFactory->createCallWithName($call, 'assertEqualsIgnoringCase'); - $newMethodCall->args[0] = $call->args[0]; - $newMethodCall->args[1] = $call->args[1]; + $newMethodCall->args[0] = $call->getArgs()[0]; + $newMethodCall->args[1] = $call->getArgs()[1]; if (!$this->valueResolver->isValue($args[2]->value, '')) { $newMethodCall->args[2] = $args[2]; } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertFalseStrposToContainsRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertFalseStrposToContainsRector.php index 797b70deea3..1097928d3bf 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertFalseStrposToContainsRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertFalseStrposToContainsRector.php @@ -56,7 +56,7 @@ final class AssertFalseStrposToContainsRector extends AbstractRector if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, $oldMethodName)) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if ($firstArgumentValue instanceof StaticCall) { return null; } @@ -80,8 +80,8 @@ final class AssertFalseStrposToContainsRector extends AbstractRector if (!$strposFuncCallNode instanceof FuncCall) { return null; } - $firstArgument = $strposFuncCallNode->args[1]; - $secondArgument = $strposFuncCallNode->args[0]; + $firstArgument = $strposFuncCallNode->getArgs()[1]; + $secondArgument = $strposFuncCallNode->getArgs()[0]; unset($oldArguments[0]); $newArgs = [$firstArgument, $secondArgument]; $node->args = $this->appendArgs($newArgs, $oldArguments); diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertInstanceOfComparisonRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertInstanceOfComparisonRector.php index e2703a91e61..846d0f03ce4 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertInstanceOfComparisonRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertInstanceOfComparisonRector.php @@ -58,7 +58,7 @@ final class AssertInstanceOfComparisonRector extends AbstractRector if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, $oldMethodNames)) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if (!$firstArgumentValue instanceof Instanceof_) { return null; } @@ -71,7 +71,7 @@ final class AssertInstanceOfComparisonRector extends AbstractRector */ private function changeArgumentsOrder($node) : void { - $oldArguments = $node->args; + $oldArguments = $node->getArgs(); /** @var Instanceof_ $comparison */ $comparison = $oldArguments[0]->value; $argument = $comparison->expr; diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertIssetToSpecificMethodRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertIssetToSpecificMethodRector.php index 6dba8bb9c7a..738c6d7b195 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertIssetToSpecificMethodRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertIssetToSpecificMethodRector.php @@ -81,7 +81,7 @@ final class AssertIssetToSpecificMethodRector extends AbstractRector if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, [self::ASSERT_TRUE, self::ASSERT_FALSE])) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; // is property access if (!$firstArgumentValue instanceof Isset_) { return null; @@ -91,7 +91,7 @@ final class AssertIssetToSpecificMethodRector extends AbstractRector return null; } /** @var Isset_ $issetNode */ - $issetNode = $node->args[0]->value; + $issetNode = $node->getArgs()[0]->value; $issetNodeArg = $issetNode->vars[0]; if ($issetNodeArg instanceof PropertyFetch) { if ($this->hasMagicIsset($issetNodeArg->var)) { @@ -141,7 +141,7 @@ final class AssertIssetToSpecificMethodRector extends AbstractRector return null; } $this->identifierManipulator->renameNodeWithMap($node, [self::ASSERT_TRUE => 'assertObjectHasAttribute', self::ASSERT_FALSE => 'assertObjectNotHasAttribute']); - $oldArgs = $node->args; + $oldArgs = $node->getArgs(); unset($oldArgs[0]); $newArgs = $this->nodeFactory->createArgs([new String_($name), $propertyFetch->var]); $node->args = $this->appendArgs($newArgs, $oldArgs); @@ -153,7 +153,7 @@ final class AssertIssetToSpecificMethodRector extends AbstractRector private function refactorArrayDimFetchNode($node, ArrayDimFetch $arrayDimFetch) : Node { $this->identifierManipulator->renameNodeWithMap($node, [self::ASSERT_TRUE => 'assertArrayHasKey', self::ASSERT_FALSE => 'assertArrayNotHasKey']); - $oldArgs = $node->args; + $oldArgs = $node->getArgs(); unset($oldArgs[0]); $node->args = \array_merge($this->nodeFactory->createArgs([$arrayDimFetch->dim, $arrayDimFetch->var]), $oldArgs); return $node; diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertNotOperatorRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertNotOperatorRector.php index 8b842c172db..e2009d33112 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertNotOperatorRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertNotOperatorRector.php @@ -57,12 +57,12 @@ final class AssertNotOperatorRector extends AbstractRector if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, $oldMethodNames)) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if (!$firstArgumentValue instanceof BooleanNot) { return null; } $this->identifierManipulator->renameNodeWithMap($node, self::RENAME_METHODS_MAP); - $oldArguments = $node->args; + $oldArguments = $node->getArgs(); /** @var BooleanNot $negation */ $negation = $oldArguments[0]->value; $expression = $negation->expr; diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertPropertyExistsRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertPropertyExistsRector.php index f93c511664c..e58296bf333 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertPropertyExistsRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertPropertyExistsRector.php @@ -70,19 +70,19 @@ CODE_SAMPLE if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, ['assertTrue', 'assertFalse'])) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if (!$firstArgumentValue instanceof FuncCall) { return null; } if (!$this->isName($firstArgumentValue, 'property_exists')) { return null; } - $propertyExistsMethodCall = $node->args[0]->value; + $propertyExistsMethodCall = $node->getArgs()[0]->value; if (!$propertyExistsMethodCall instanceof FuncCall) { return null; } - $firstArgument = $propertyExistsMethodCall->args[0]; - $secondArgument = $propertyExistsMethodCall->args[1]; + $firstArgument = $propertyExistsMethodCall->getArgs()[0]; + $secondArgument = $propertyExistsMethodCall->getArgs()[1]; if ($firstArgument->value instanceof Variable) { $secondArg = new Variable($firstArgument->value->name); $map = self::RENAME_METHODS_WITH_OBJECT_MAP; @@ -97,7 +97,7 @@ CODE_SAMPLE } unset($node->args[0]); $newArgs = $this->nodeFactory->createArgs([$secondArgument->value->value, $secondArg]); - $node->args = $this->appendArgs($newArgs, $node->args); + $node->args = $this->appendArgs($newArgs, $node->getArgs()); $this->identifierManipulator->renameNodeWithMap($node, $map); return $node; } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertRegExpRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertRegExpRector.php index 160bfec093a..9482da7597f 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertRegExpRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertRegExpRector.php @@ -66,7 +66,7 @@ final class AssertRegExpRector extends AbstractRector return null; } /** @var FuncCall|Node $secondArgumentValue */ - $secondArgumentValue = $node->args[1]->value; + $secondArgumentValue = $node->getArgs()[1]->value; if (!$secondArgumentValue instanceof FuncCall) { return null; } @@ -77,7 +77,7 @@ final class AssertRegExpRector extends AbstractRector if ($oldMethodName === null) { return null; } - $oldFirstArgument = $node->args[0]->value; + $oldFirstArgument = $node->getArgs()[0]->value; $oldCondition = $this->resolveOldCondition($oldFirstArgument); $this->renameMethod($node, $oldMethodName, $oldCondition); $this->moveFunctionArgumentsUp($node); @@ -110,11 +110,11 @@ final class AssertRegExpRector extends AbstractRector */ private function moveFunctionArgumentsUp($node) : void { - $oldArguments = $node->args; + $oldArguments = $node->getArgs(); /** @var FuncCall $pregMatchFunction */ $pregMatchFunction = $oldArguments[1]->value; - $regex = $pregMatchFunction->args[0]; - $variable = $pregMatchFunction->args[1]; + $regex = $pregMatchFunction->getArgs()[0]; + $variable = $pregMatchFunction->getArgs()[1]; unset($oldArguments[0], $oldArguments[1]); $node->args = \array_merge([$regex, $variable], $oldArguments); } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertResourceToClosedResourceRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertResourceToClosedResourceRector.php index 55cc3a873d4..74139f1ce77 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertResourceToClosedResourceRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertResourceToClosedResourceRector.php @@ -60,7 +60,7 @@ final class AssertResourceToClosedResourceRector extends AbstractRector if (!$this->isNames($node->name, $methodNames)) { return null; } - if (!isset($node->args[0])) { + if (!isset($node->getArgs()[0])) { return null; } $this->identifierManipulator->renameNodeWithMap($node, self::RENAME_METHODS_MAP); diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameBoolNullToSpecificMethodRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameBoolNullToSpecificMethodRector.php index 4a49911ba08..ade87e845eb 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameBoolNullToSpecificMethodRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameBoolNullToSpecificMethodRector.php @@ -64,7 +64,7 @@ final class AssertSameBoolNullToSpecificMethodRector extends AbstractRector if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, ['assertSame', 'assertNotSame'])) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if (!$firstArgumentValue instanceof ConstFetch) { return null; } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameTrueFalseToAssertTrueFalseRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameTrueFalseToAssertTrueFalseRector.php index 45adf0198d3..2e5f8583ddd 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameTrueFalseToAssertTrueFalseRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertSameTrueFalseToAssertTrueFalseRector.php @@ -74,12 +74,13 @@ CODE_SAMPLE if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, ['assertSame', 'assertEqual', 'assertNotSame', 'assertNotEqual'])) { return null; } - if ($this->valueResolver->isTrue($node->args[0]->value)) { + $firstArg = $node->getArgs()[0]; + if ($this->valueResolver->isTrue($firstArg->value)) { $this->argumentMover->removeFirst($node); $node->name = new Identifier('assertTrue'); return $node; } - if ($this->valueResolver->isFalse($node->args[0]->value)) { + if ($this->valueResolver->isFalse($firstArg->value)) { $this->argumentMover->removeFirst($node); $node->name = new Identifier('assertFalse'); return $node; diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseInternalTypeToSpecificMethodRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseInternalTypeToSpecificMethodRector.php index 250a9a2fd3e..3b458d487b6 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseInternalTypeToSpecificMethodRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseInternalTypeToSpecificMethodRector.php @@ -62,8 +62,7 @@ final class AssertTrueFalseInternalTypeToSpecificMethodRector extends AbstractRe if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, $oldMethods)) { return null; } - /** @var FuncCall|Node $firstArgumentValue */ - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if (!$firstArgumentValue instanceof FuncCall) { return null; } @@ -80,11 +79,11 @@ final class AssertTrueFalseInternalTypeToSpecificMethodRector extends AbstractRe private function moveFunctionArgumentsUp($node) : Node { /** @var FuncCall $isFunctionNode */ - $isFunctionNode = $node->args[0]->value; - $firstArgumentValue = $isFunctionNode->args[0]->value; + $isFunctionNode = $node->getArgs()[0]->value; + $firstArgumentValue = $isFunctionNode->getArgs()[0]->value; $isFunctionName = $this->getName($isFunctionNode); $newArgs = [new Arg(new String_(self::OLD_FUNCTIONS_TO_TYPES[$isFunctionName])), new Arg($firstArgumentValue)]; - $oldArguments = $node->args; + $oldArguments = $node->getArgs(); unset($oldArguments[0]); $node->args = $this->appendArgs($newArgs, $oldArguments); return $node; diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php index 3eb7d3b7611..b09dcd17604 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/AssertTrueFalseToSpecificMethodRector.php @@ -56,7 +56,7 @@ final class AssertTrueFalseToSpecificMethodRector extends AbstractRector if (!isset($node->args[0])) { return null; } - $firstArgumentValue = $node->args[0]->value; + $firstArgumentValue = $node->getArgs()[0]->value; if (!$firstArgumentValue instanceof FuncCall && !$firstArgumentValue instanceof Empty_) { return null; } @@ -103,14 +103,14 @@ final class AssertTrueFalseToSpecificMethodRector extends AbstractRector */ private function moveFunctionArgumentsUp($node) : void { - $funcCallOrEmptyNode = $node->args[0]->value; + $funcCallOrEmptyNode = $node->getArgs()[0]->value; if ($funcCallOrEmptyNode instanceof FuncCall) { $funcCallOrEmptyNodeName = $this->getName($funcCallOrEmptyNode); if ($funcCallOrEmptyNodeName === null) { return; } - $funcCallOrEmptyNodeArgs = $funcCallOrEmptyNode->args; - $oldArguments = $node->args; + $funcCallOrEmptyNodeArgs = $funcCallOrEmptyNode->getArgs(); + $oldArguments = $node->getArgs(); unset($oldArguments[0]); $node->args = $this->buildNewArguments($funcCallOrEmptyNodeName, $funcCallOrEmptyNodeArgs, $oldArguments); } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/ExplicitPhpErrorApiRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/ExplicitPhpErrorApiRector.php index 58c482ae982..be8e48e9c01 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/ExplicitPhpErrorApiRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/ExplicitPhpErrorApiRector.php @@ -96,10 +96,11 @@ CODE_SAMPLE */ private function replaceExceptionWith($node, string $exceptionClass, string $explicitMethod) : ?Node { - if (!isset($node->args[0])) { + if (!isset($node->getArgs()[0])) { return null; } - if (!$this->isClassConstReference($node->args[0]->value, $exceptionClass)) { + $firstArg = $node->getArgs()[0]; + if (!$this->isClassConstReference($firstArg->value, $exceptionClass)) { return null; } return $this->assertCallFactory->createCallWithName($node, $explicitMethod); diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/RemoveExpectAnyFromMockRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/RemoveExpectAnyFromMockRector.php index 44220ce9018..0a7e2e64951 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/RemoveExpectAnyFromMockRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/RemoveExpectAnyFromMockRector.php @@ -77,7 +77,7 @@ CODE_SAMPLE if (\count($node->args) !== 1) { return null; } - $onlyArgument = $node->args[0]->value; + $onlyArgument = $node->getArgs()[0]->value; if (!$this->isMethodCallOnVariableNamed($onlyArgument, 'this', 'any')) { return null; } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsRector.php index 574b6d4aa4c..3d34bf6e468 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsRector.php @@ -73,7 +73,7 @@ CODE_SAMPLE if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, ['assertContains', 'assertNotContains'])) { return null; } - if (!$this->isPossiblyStringType($node->args[1]->value)) { + if (!$this->isPossiblyStringType($node->getArgs()[1]->value)) { return null; } $methodName = $this->getName($node->name); diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsWithoutIdentityRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsWithoutIdentityRector.php index 09ec8091bdb..0e042e6a81b 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsWithoutIdentityRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertContainsWithoutIdentityRector.php @@ -73,19 +73,17 @@ CODE_SAMPLE return null; } // when second argument is string: do nothing - $secondArgType = $this->getType($node->args[1]->value); + $secondArgType = $this->getType($node->getArgs()[1]->value); if ($secondArgType instanceof StringType) { return null; } //when less then 5 arguments given: do nothing - if (!isset($node->args[4])) { - return null; - } - if ($node->args[4]->value === null) { + if (!isset($node->getArgs()[4])) { return null; } + $fourthArg = $node->getArgs()[4]; //when 5th argument check identity is true: do nothing - if ($this->valueResolver->isValue($node->args[4]->value, \true)) { + if ($this->valueResolver->isValue($fourthArg->value, \true)) { return null; } /* here we search for element of array without identity check and we can replace functions */ diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertInternalTypeRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertInternalTypeRector.php index 2e347f47ec1..4ca3003d575 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertInternalTypeRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/SpecificAssertInternalTypeRector.php @@ -73,7 +73,7 @@ CODE_SAMPLE if (!$this->testsNodeAnalyzer->isPHPUnitMethodCallNames($node, ['assertInternalType', 'assertNotInternalType'])) { return null; } - $typeNode = $node->args[0]->value; + $typeNode = $node->getArgs()[0]->value; if (!$typeNode instanceof String_) { return null; } diff --git a/vendor/rector/rector-phpunit/src/Rector/MethodCall/UseSpecificWithMethodRector.php b/vendor/rector/rector-phpunit/src/Rector/MethodCall/UseSpecificWithMethodRector.php index 48c71652b49..3c246b5c605 100644 --- a/vendor/rector/rector-phpunit/src/Rector/MethodCall/UseSpecificWithMethodRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/MethodCall/UseSpecificWithMethodRector.php @@ -82,7 +82,7 @@ CODE_SAMPLE if (!$this->isName($methodCall->name, 'equalTo')) { continue; } - $node->args[$i] = $methodCall->args[0]; + $node->args[$i] = $methodCall->getArgs()[0]; } return $node; } diff --git a/vendor/rector/rector-phpunit/src/Rector/StaticCall/GetMockRector.php b/vendor/rector/rector-phpunit/src/Rector/StaticCall/GetMockRector.php index f9d3d1c80cb..e5a48b342d2 100644 --- a/vendor/rector/rector-phpunit/src/Rector/StaticCall/GetMockRector.php +++ b/vendor/rector/rector-phpunit/src/Rector/StaticCall/GetMockRector.php @@ -86,7 +86,7 @@ CODE_SAMPLE } // narrow args to one if (\count($node->args) > 1) { - $node->args = [$node->args[0]]; + $node->args = [$node->getArgs()[0]]; } $node->name = new Identifier('createMock'); return $node; diff --git a/vendor/rector/rector-phpunit/src/ValueObject/DataProviderClassMethodRecipe.php b/vendor/rector/rector-phpunit/src/ValueObject/DataProviderClassMethodRecipe.php index 98d2bf99736..fb5bcd04c69 100644 --- a/vendor/rector/rector-phpunit/src/ValueObject/DataProviderClassMethodRecipe.php +++ b/vendor/rector/rector-phpunit/src/ValueObject/DataProviderClassMethodRecipe.php @@ -4,6 +4,7 @@ declare (strict_types=1); namespace Rector\PHPUnit\ValueObject; use PhpParser\Node\Arg; +use RectorPrefix202305\Webmozart\Assert\Assert; final class DataProviderClassMethodRecipe { /** @@ -23,6 +24,7 @@ final class DataProviderClassMethodRecipe { $this->methodName = $methodName; $this->args = $args; + Assert::allIsInstanceOf($args, Arg::class); } public function getMethodName() : string {