From 168d6a72a1878afa175b9f09ff47a97231b3e0dc Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 16 Dec 2023 15:55:14 +0000 Subject: [PATCH] Updated Rector to commit 120e0ccfc40bc696d23a9e1d93b6662ea7dfa682 https://github.com/rectorphp/rector-src/commit/120e0ccfc40bc696d23a9e1d93b6662ea7dfa682 Bump to php parser 4.18 (#5362) --- .../RemoveNullTagValueNodeRector.php | 68 +++++++++---------- .../StringClassNameToClassConstantRector.php | 8 +-- src/Application/VersionResolver.php | 4 +- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +-- vendor/composer/autoload_static.php | 8 +-- 6 files changed, 50 insertions(+), 50 deletions(-) diff --git a/rules/DeadCode/Rector/ClassMethod/RemoveNullTagValueNodeRector.php b/rules/DeadCode/Rector/ClassMethod/RemoveNullTagValueNodeRector.php index 2e02b7a1674c..bd073a580ec4 100644 --- a/rules/DeadCode/Rector/ClassMethod/RemoveNullTagValueNodeRector.php +++ b/rules/DeadCode/Rector/ClassMethod/RemoveNullTagValueNodeRector.php @@ -73,6 +73,40 @@ public function getNodeTypes() : array { return [ClassMethod::class, Function_::class, Expression::class, Property::class]; } + /** + * @param ClassMethod|Function_|Expression|Property $node + */ + public function refactor(Node $node) : ?Node + { + if ($node instanceof Expression || $node instanceof Property) { + return $this->processVarTagNull($node); + } + $phpdocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); + $removedParamNames = []; + foreach ($node->params as $param) { + $paramName = $this->getName($param); + $paramTagValueNode = $phpdocInfo->getParamTagValueByName($paramName); + if ($paramTagValueNode instanceof ParamTagValueNode && $this->isNull($paramTagValueNode)) { + $removedParamNames[] = $paramTagValueNode->parameterName; + } + } + $hasRemoved = \false; + if ($removedParamNames !== []) { + $this->removeParamNullTag($phpdocInfo, $removedParamNames); + $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node); + $hasRemoved = \true; + } + $returnTagValueNode = $phpdocInfo->getReturnTagValue(); + if ($returnTagValueNode instanceof ReturnTagValueNode && $this->isNull($returnTagValueNode)) { + $phpdocInfo->removeByType(ReturnTagValueNode::class); + $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node); + $hasRemoved = \true; + } + if (!$hasRemoved) { + return null; + } + return $node; + } /** * @param \PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode|\PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode|\PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode $tag */ @@ -113,38 +147,4 @@ private function processVarTagNull($node) : ?Node } return null; } - /** - * @param ClassMethod|Function_|Expression|Property $node - */ - public function refactor(Node $node) : ?Node - { - if ($node instanceof Expression || $node instanceof Property) { - return $this->processVarTagNull($node); - } - $phpdocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); - $removedParamNames = []; - foreach ($node->params as $param) { - $paramName = $this->getName($param); - $paramTagValueNode = $phpdocInfo->getParamTagValueByName($paramName); - if ($paramTagValueNode instanceof ParamTagValueNode && $this->isNull($paramTagValueNode)) { - $removedParamNames[] = $paramTagValueNode->parameterName; - } - } - $hasRemoved = \false; - if ($removedParamNames !== []) { - $this->removeParamNullTag($phpdocInfo, $removedParamNames); - $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node); - $hasRemoved = \true; - } - $returnTagValueNode = $phpdocInfo->getReturnTagValue(); - if ($returnTagValueNode instanceof ReturnTagValueNode && $this->isNull($returnTagValueNode)) { - $phpdocInfo->removeByType(ReturnTagValueNode::class); - $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node); - $hasRemoved = \true; - } - if (!$hasRemoved) { - return null; - } - return $node; - } } diff --git a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php index 73568a547a2b..6c0d14982d7f 100644 --- a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php +++ b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php @@ -31,6 +31,10 @@ final class StringClassNameToClassConstantRector extends AbstractRector implemen * @var \PHPStan\Reflection\ReflectionProvider */ private $reflectionProvider; + /** + * @var string + */ + public const SHOULD_KEEP_PRE_SLASH = 'should_keep_pre_slash'; /** * @var string */ @@ -43,10 +47,6 @@ final class StringClassNameToClassConstantRector extends AbstractRector implemen * @var bool */ private $shouldKeepPreslash = \false; - /** - * @var string - */ - public const SHOULD_KEEP_PRE_SLASH = 'should_keep_pre_slash'; public function __construct(ReflectionProvider $reflectionProvider) { $this->reflectionProvider = $reflectionProvider; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index d9c3ddefe41f..86538a20f7c8 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 = '39cce5ccb84ce4ac40eeae113db339a961db9489'; + public const PACKAGE_VERSION = '120e0ccfc40bc696d23a9e1d93b6662ea7dfa682'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-12-16 16:40:38'; + public const RELEASE_DATE = '2023-12-16 15:53:06'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index 648fa600bbe4..9bb987d0b6a0 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInita55c41c7fa52abd86138c6f32df1d185::getLoader(); +return ComposerAutoloaderInit8339caf294dd12447c06647e5d0dc118::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index a2ec0c9117be..9a64c831b32c 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInita55c41c7fa52abd86138c6f32df1d185 +class ComposerAutoloaderInit8339caf294dd12447c06647e5d0dc118 { private static $loader; @@ -22,17 +22,17 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInita55c41c7fa52abd86138c6f32df1d185', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit8339caf294dd12447c06647e5d0dc118', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInita55c41c7fa52abd86138c6f32df1d185', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit8339caf294dd12447c06647e5d0dc118', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInita55c41c7fa52abd86138c6f32df1d185::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit8339caf294dd12447c06647e5d0dc118::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInita55c41c7fa52abd86138c6f32df1d185::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit8339caf294dd12447c06647e5d0dc118::$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 9325e122f000..812298ac3719 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInita55c41c7fa52abd86138c6f32df1d185 +class ComposerStaticInit8339caf294dd12447c06647e5d0dc118 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -2619,9 +2619,9 @@ class ComposerStaticInita55c41c7fa52abd86138c6f32df1d185 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInita55c41c7fa52abd86138c6f32df1d185::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInita55c41c7fa52abd86138c6f32df1d185::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInita55c41c7fa52abd86138c6f32df1d185::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit8339caf294dd12447c06647e5d0dc118::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit8339caf294dd12447c06647e5d0dc118::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit8339caf294dd12447c06647e5d0dc118::$classMap; }, null, ClassLoader::class); }