From b9cd894841a4330a1db42fd1e423355f33f4e4f8 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 19 Aug 2021 06:27:27 +0000 Subject: [PATCH] Updated Rector to commit da038480cd5c44465dc6b6b3efc116b2baa03e24 https://github.com/rectorphp/rector-src/commit/da038480cd5c44465dc6b6b3efc116b2baa03e24 [DeadCode] Skip @return removal on Trait_ on RemoveUselessReturnTagRector (#715) --- .../PhpDoc/DeadReturnTagValueNodeAnalyzer.php | 7 +++++++ src/Application/VersionResolver.php | 4 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +++++++------- vendor/composer/autoload_static.php | 8 ++++---- vendor/scoper-autoload.php | 10 +++++----- 6 files changed, 26 insertions(+), 19 deletions(-) diff --git a/rules/DeadCode/PhpDoc/DeadReturnTagValueNodeAnalyzer.php b/rules/DeadCode/PhpDoc/DeadReturnTagValueNodeAnalyzer.php index bace50fa689..44677c1535d 100644 --- a/rules/DeadCode/PhpDoc/DeadReturnTagValueNodeAnalyzer.php +++ b/rules/DeadCode/PhpDoc/DeadReturnTagValueNodeAnalyzer.php @@ -4,11 +4,14 @@ declare (strict_types=1); namespace Rector\DeadCode\PhpDoc; use PhpParser\Node\FunctionLike; +use PhpParser\Node\Stmt\Trait_; use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; +use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode; use Rector\BetterPhpDocParser\ValueObject\Type\BracketsAwareUnionTypeNode; use Rector\BetterPhpDocParser\ValueObject\Type\SpacingAwareCallableTypeNode; +use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\NodeTypeResolver\TypeComparator\TypeComparator; final class DeadReturnTagValueNodeAnalyzer { @@ -26,6 +29,10 @@ final class DeadReturnTagValueNodeAnalyzer if ($returnType === null) { return \false; } + $classLike = $functionLike->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CLASS_NODE); + if ($classLike instanceof \PhpParser\Node\Stmt\Trait_ && $returnTagValueNode->type instanceof \PHPStan\PhpDocParser\Ast\Type\ThisTypeNode) { + return \false; + } if (!$this->typeComparator->arePhpParserAndPhpStanPhpDocTypesEqual($returnType, $returnTagValueNode->type, $functionLike)) { return \false; } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 067930a2226..9b16443ab0a 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = '276df2530507662f598f534c53685c19e5abd017'; + public const PACKAGE_VERSION = 'da038480cd5c44465dc6b6b3efc116b2baa03e24'; /** * @var string */ - public const RELEASE_DATE = '2021-08-19 04:05:31'; + public const RELEASE_DATE = '2021-08-19 08:13:28'; public static function resolvePackageVersion() : string { $process = new \RectorPrefix20210819\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); diff --git a/vendor/autoload.php b/vendor/autoload.php index 0b1dd6fc3d2..23aa31cbe8b 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f::getLoader(); +return ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ebba3374486..eb0f0f2adb1 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f +class ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04 { private static $loader; @@ -22,15 +22,15 @@ class ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitf80801e6e7c0b2b3c60e4a62683d916f::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitaeefbff0697ef0f9b7cf79fb978c8f04::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { @@ -42,19 +42,19 @@ class ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitf80801e6e7c0b2b3c60e4a62683d916f::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitaeefbff0697ef0f9b7cf79fb978c8f04::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequiref80801e6e7c0b2b3c60e4a62683d916f($fileIdentifier, $file); + composerRequireaeefbff0697ef0f9b7cf79fb978c8f04($fileIdentifier, $file); } return $loader; } } -function composerRequiref80801e6e7c0b2b3c60e4a62683d916f($fileIdentifier, $file) +function composerRequireaeefbff0697ef0f9b7cf79fb978c8f04($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 2fda99202a6..7a7fc0efa3a 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitf80801e6e7c0b2b3c60e4a62683d916f +class ComposerStaticInitaeefbff0697ef0f9b7cf79fb978c8f04 { public static $files = array ( 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', @@ -3851,9 +3851,9 @@ class ComposerStaticInitf80801e6e7c0b2b3c60e4a62683d916f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitf80801e6e7c0b2b3c60e4a62683d916f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitf80801e6e7c0b2b3c60e4a62683d916f::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitf80801e6e7c0b2b3c60e4a62683d916f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitaeefbff0697ef0f9b7cf79fb978c8f04::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitaeefbff0697ef0f9b7cf79fb978c8f04::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitaeefbff0697ef0f9b7cf79fb978c8f04::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index 089efcf2bcc..bd19c190fda 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php'; if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) { spl_autoload_call('RectorPrefix20210819\AutoloadIncluder'); } -if (!class_exists('ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f', false) && !interface_exists('ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f', false) && !trait_exists('ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f', false)) { - spl_autoload_call('RectorPrefix20210819\ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f'); +if (!class_exists('ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04', false) && !interface_exists('ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04', false) && !trait_exists('ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04', false)) { + spl_autoload_call('RectorPrefix20210819\ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04'); } if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) { spl_autoload_call('RectorPrefix20210819\Helmich\TypoScriptParser\Parser\AST\Statement'); @@ -3308,9 +3308,9 @@ if (!function_exists('print_node')) { return \RectorPrefix20210819\print_node(...func_get_args()); } } -if (!function_exists('composerRequiref80801e6e7c0b2b3c60e4a62683d916f')) { - function composerRequiref80801e6e7c0b2b3c60e4a62683d916f() { - return \RectorPrefix20210819\composerRequiref80801e6e7c0b2b3c60e4a62683d916f(...func_get_args()); +if (!function_exists('composerRequireaeefbff0697ef0f9b7cf79fb978c8f04')) { + function composerRequireaeefbff0697ef0f9b7cf79fb978c8f04() { + return \RectorPrefix20210819\composerRequireaeefbff0697ef0f9b7cf79fb978c8f04(...func_get_args()); } } if (!function_exists('parseArgs')) {