From f4f965b7bae0658f92dfee56dcb884cebbfc280f Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 14 Jun 2023 05:36:12 +0000 Subject: [PATCH] Updated Rector to commit dac6b46cdbd4a7820d923af040d1f8627faced39 https://github.com/rectorphp/rector-src/commit/dac6b46cdbd4a7820d923af040d1f8627faced39 [Docblock] Ensure update Refactored php_doc_info after keep comments on ClassMethod on keep comments (#4221) --- .../PhpDocManipulator/PhpDocTypeChanger.php | 11 ++++++----- src/Application/VersionResolver.php | 4 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/BetterPhpDocParser/PhpDocManipulator/PhpDocTypeChanger.php b/packages/BetterPhpDocParser/PhpDocManipulator/PhpDocTypeChanger.php index f62f36e1f98f..c8ac25bc1344 100644 --- a/packages/BetterPhpDocParser/PhpDocManipulator/PhpDocTypeChanger.php +++ b/packages/BetterPhpDocParser/PhpDocManipulator/PhpDocTypeChanger.php @@ -215,7 +215,7 @@ public function copyPropertyDocToParam(ClassMethod $classMethod, Property $prope } $varTagValueNode = $phpDocInfo->getVarTagValueNode(); if (!$varTagValueNode instanceof VarTagValueNode) { - $this->processKeepComments($property, $param); + $this->processKeepComments($classMethod, $property, $param); return; } if ($varTagValueNode->description !== '') { @@ -229,13 +229,12 @@ public function copyPropertyDocToParam(ClassMethod $classMethod, Property $prope return; } $phpDocInfo->removeByType(VarTagValueNode::class); + $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($property); $param->setAttribute(AttributeKey::PHP_DOC_INFO, $phpDocInfo); $phpDocInfo = $classMethod->getAttribute(AttributeKey::PHP_DOC_INFO); $paramType = $this->staticTypeMapper->mapPHPStanPhpDocTypeToPHPStanType($varTagValueNode, $property); $this->changeParamType($classMethod, $phpDocInfo, $paramType, $param, $paramVarName); - $this->processKeepComments($property, $param); - $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($classMethod); - $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($property); + $this->processKeepComments($classMethod, $property, $param); } /** * @api doctrine @@ -247,12 +246,13 @@ public function changeVarTypeNode(Stmt $stmt, PhpDocInfo $phpDocInfo, TypeNode $ $phpDocInfo->addTagValueNode($varTagValueNode); $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($stmt); } - private function processKeepComments(Property $property, Param $param) : void + private function processKeepComments(ClassMethod $classMethod, Property $property, Param $param) : void { $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($param); $varTagValueNode = $phpDocInfo->getVarTagValueNode(); $toBeRemoved = !$varTagValueNode instanceof VarTagValueNode; $this->commentsMerger->keepComments($param, [$property]); + $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($classMethod); $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($param); $varTagValueNode = $phpDocInfo->getVarTagValueNode(); if (!$toBeRemoved) { @@ -265,5 +265,6 @@ private function processKeepComments(Property $property, Param $param) : void return; } $phpDocInfo->removeByType(VarTagValueNode::class); + $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($classMethod); } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index ca4c11336d71..7831e95d174d 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 = 'e11e77f6c345558fa8f6593a26c2a3c012b8d581'; + public const PACKAGE_VERSION = 'dac6b46cdbd4a7820d923af040d1f8627faced39'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-06-14 05:13:18'; + public const RELEASE_DATE = '2023-06-14 12:32:12'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index 4622f50a155b..42c13154fdc8 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit00682ea3daa7c60eb8c7dba644b00a1f::getLoader(); +return ComposerAutoloaderInitc728ed1dc8f85bd424a3fcae2c1da8b1::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index cbfda7b9f6c7..40e10b8e5792 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit00682ea3daa7c60eb8c7dba644b00a1f +class ComposerAutoloaderInitc728ed1dc8f85bd424a3fcae2c1da8b1 { private static $loader; @@ -22,17 +22,17 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit00682ea3daa7c60eb8c7dba644b00a1f', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitc728ed1dc8f85bd424a3fcae2c1da8b1', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit00682ea3daa7c60eb8c7dba644b00a1f', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitc728ed1dc8f85bd424a3fcae2c1da8b1', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit00682ea3daa7c60eb8c7dba644b00a1f::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitc728ed1dc8f85bd424a3fcae2c1da8b1::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit00682ea3daa7c60eb8c7dba644b00a1f::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitc728ed1dc8f85bd424a3fcae2c1da8b1::$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 434e01e1bb01..a5748decedef 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit00682ea3daa7c60eb8c7dba644b00a1f +class ComposerStaticInitc728ed1dc8f85bd424a3fcae2c1da8b1 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3092,9 +3092,9 @@ class ComposerStaticInit00682ea3daa7c60eb8c7dba644b00a1f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit00682ea3daa7c60eb8c7dba644b00a1f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit00682ea3daa7c60eb8c7dba644b00a1f::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit00682ea3daa7c60eb8c7dba644b00a1f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitc728ed1dc8f85bd424a3fcae2c1da8b1::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitc728ed1dc8f85bd424a3fcae2c1da8b1::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitc728ed1dc8f85bd424a3fcae2c1da8b1::$classMap; }, null, ClassLoader::class); }