diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index ea2cff2d65d..fba03d5a05e 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 = 'ed7426f02db446090399165a884ea7082e160d50'; + public const PACKAGE_VERSION = 'fcfddd9408e2d678c4b9ab6c5c9fa77e90228b73'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-08-09 21:15:26'; + public const RELEASE_DATE = '2023-08-09 21:23:41'; /** * @var int */ diff --git a/src/Rector/AbstractRector.php b/src/Rector/AbstractRector.php index cf8f322ba58..e5ef75d25a2 100644 --- a/src/Rector/AbstractRector.php +++ b/src/Rector/AbstractRector.php @@ -170,7 +170,8 @@ CODE_SAMPLE; if (!$this->isMatchingNodeType($node)) { return null; } - if ($this->shouldSkipCurrentNode($node)) { + $filePath = $this->file->getFilePath(); + if ($this->skipper->shouldSkipCurrentNode($this, $filePath, static::class, $node)) { return null; } $isDebug = $this->rectorOutput->isDebug(); @@ -178,7 +179,6 @@ CODE_SAMPLE; // for PHP doc info factory and change notifier $this->currentNodeProvider->setNode($node); if ($isDebug) { - $filePath = $this->file->getFilePath(); $this->rectorOutput->printCurrentFileAndRule($filePath, static::class); } $this->changedNodeScopeRefresher->reIndexNodeAttributes($node); @@ -214,7 +214,7 @@ CODE_SAMPLE; $errorMessage = \sprintf(self::EMPTY_NODE_ARRAY_MESSAGE, static::class); throw new ShouldNotHappenException($errorMessage); } - return $this->postRefactorProcess($originalNode, $node, $refactoredNode); + return $this->postRefactorProcess($originalNode, $node, $refactoredNode, $filePath); } /** * Replacing nodes in leaveNode() method avoids infinite recursion @@ -279,7 +279,7 @@ CODE_SAMPLE; /** * @param \PhpParser\Node|mixed[]|int $refactoredNode */ - private function postRefactorProcess(Node $originalNode, Node $node, $refactoredNode) : Node + private function postRefactorProcess(Node $originalNode, Node $node, $refactoredNode, string $filePath) : Node { /** @var non-empty-array|Node $refactoredNode */ $this->createdByRuleDecorator->decorate($refactoredNode, $originalNode, static::class); @@ -287,7 +287,6 @@ CODE_SAMPLE; $this->file->addRectorClassWithLine($rectorWithLineChange); /** @var MutatingScope|null $currentScope */ $currentScope = $node->getAttribute(AttributeKey::SCOPE); - $filePath = $this->file->getFilePath(); // search "infinite recursion" in https://github.com/nikic/PHP-Parser/blob/master/doc/component/Walking_the_AST.markdown $originalNodeHash = \spl_object_hash($originalNode); if (\is_array($refactoredNode)) { @@ -326,9 +325,4 @@ CODE_SAMPLE; } return \false; } - private function shouldSkipCurrentNode(Node $node) : bool - { - $filePath = $this->file->getFilePath(); - return $this->skipper->shouldSkipCurrentNode($this, $filePath, static::class, $node); - } } diff --git a/vendor/autoload.php b/vendor/autoload.php index e29c9f8b70b..a66aa6c23f8 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 ComposerAutoloaderInit9e6ca8979a9899d08b2b3cdd32c2c704::getLoader(); +return ComposerAutoloaderInit8c947d124e33364edd40aaf8a001d88f::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index c62a39b51ba..1bad3f2d8b0 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit9e6ca8979a9899d08b2b3cdd32c2c704 +class ComposerAutoloaderInit8c947d124e33364edd40aaf8a001d88f { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit9e6ca8979a9899d08b2b3cdd32c2c704 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit9e6ca8979a9899d08b2b3cdd32c2c704', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit8c947d124e33364edd40aaf8a001d88f', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit9e6ca8979a9899d08b2b3cdd32c2c704', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit8c947d124e33364edd40aaf8a001d88f', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit9e6ca8979a9899d08b2b3cdd32c2c704::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit8c947d124e33364edd40aaf8a001d88f::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit9e6ca8979a9899d08b2b3cdd32c2c704::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit8c947d124e33364edd40aaf8a001d88f::$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 6bada7798a5..d98833bf19e 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit9e6ca8979a9899d08b2b3cdd32c2c704 +class ComposerStaticInit8c947d124e33364edd40aaf8a001d88f { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3003,9 +3003,9 @@ class ComposerStaticInit9e6ca8979a9899d08b2b3cdd32c2c704 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit9e6ca8979a9899d08b2b3cdd32c2c704::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit9e6ca8979a9899d08b2b3cdd32c2c704::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit9e6ca8979a9899d08b2b3cdd32c2c704::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit8c947d124e33364edd40aaf8a001d88f::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit8c947d124e33364edd40aaf8a001d88f::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit8c947d124e33364edd40aaf8a001d88f::$classMap; }, null, ClassLoader::class); }