mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
Updated Rector to commit da038480cd5c44465dc6b6b3efc116b2baa03e24
da038480cd
[DeadCode] Skip @return removal on Trait_ on RemoveUselessReturnTagRector (#715)
This commit is contained in:
parent
1b892235ad
commit
b9cd894841
@ -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;
|
||||
}
|
||||
|
@ -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__);
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitf80801e6e7c0b2b3c60e4a62683d916f::getLoader();
|
||||
return ComposerAutoloaderInitaeefbff0697ef0f9b7cf79fb978c8f04::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -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;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -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);
|
||||
}
|
||||
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
@ -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')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user