mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-21 16:02:23 +02:00
Updated Rector to commit 7d7edc435c7c0fe95acd6c4c6bd31914c83f9aea
7d7edc435c
Revert Fix /self docblock compare removed on on-final class, as it can refer to child this type (#1246) (#1669)
This commit is contained in:
parent
56696246bd
commit
741370570f
@ -50,6 +50,7 @@ final class RectorWithLineChange implements \RectorPrefix20220117\Symplify\EasyP
|
||||
}
|
||||
/**
|
||||
* @param array<string, mixed> $json
|
||||
* @return $this
|
||||
*/
|
||||
public static function decode(array $json) : \RectorPrefix20220117\Symplify\EasyParallel\Contract\SerializableInterface
|
||||
{
|
||||
|
@ -4,10 +4,8 @@ declare (strict_types=1);
|
||||
namespace Rector\NodeTypeResolver\TypeComparator;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use PHPStan\Type\ArrayType;
|
||||
use PHPStan\Type\BooleanType;
|
||||
use PHPStan\Type\Constant\ConstantBooleanType;
|
||||
@ -22,7 +20,6 @@ use PHPStan\Type\Type;
|
||||
use PHPStan\Type\TypeTraverser;
|
||||
use PHPStan\Type\UnionType;
|
||||
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
|
||||
use Rector\NodeTypeResolver\PHPStan\TypeHasher;
|
||||
use Rector\StaticTypeMapper\StaticTypeMapper;
|
||||
@ -230,16 +227,12 @@ final class TypeComparator
|
||||
}
|
||||
private function isThisTypeInFinalClass(\PHPStan\Type\Type $phpStanDocType, \PHPStan\Type\Type $phpParserNodeType, \PhpParser\Node $node) : bool
|
||||
{
|
||||
// special case for non-final $this/self compare; in case of interface/abstract class, it can be another $this
|
||||
if ($phpStanDocType instanceof \PHPStan\Type\ThisType && $phpParserNodeType instanceof \PHPStan\Type\ThisType) {
|
||||
$scope = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
|
||||
if ($scope instanceof \PHPStan\Analyser\Scope) {
|
||||
$classReflection = $scope->getClassReflection();
|
||||
if ($classReflection instanceof \PHPStan\Reflection\ClassReflection) {
|
||||
return $classReflection->isFinal();
|
||||
}
|
||||
}
|
||||
}
|
||||
return \true;
|
||||
/**
|
||||
* Special case for $this/(self|static) compare
|
||||
*
|
||||
* $this refers to the exact object identity, not just the same type. Therefore, it's valid and should not be removed
|
||||
* @see https://wiki.php.net/rfc/this_return_type for more context
|
||||
*/
|
||||
return !($phpStanDocType instanceof \PHPStan\Type\ThisType && $phpParserNodeType instanceof \PHPStan\Type\StaticType);
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ final class VersionResolver
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '65c97a9eb9437bcc432fc6aab79604ad185d0299';
|
||||
public const PACKAGE_VERSION = '7d7edc435c7c0fe95acd6c4c6bd31914c83f9aea';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-01-17 11:12:07';
|
||||
public const RELEASE_DATE = '2022-01-17 18:04:43';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20220117\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 ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78::getLoader();
|
||||
return ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719::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 ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78
|
||||
class ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,15 +22,15 @@ class ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719', '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\ComposerStaticInit9547ff6cdaa100988ae7e917f5492b78::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit81e22985df5c50b3b6f7475a70999719::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
@ -42,12 +42,12 @@ class ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit9547ff6cdaa100988ae7e917f5492b78::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit81e22985df5c50b3b6f7475a70999719::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire9547ff6cdaa100988ae7e917f5492b78($fileIdentifier, $file);
|
||||
composerRequire81e22985df5c50b3b6f7475a70999719($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -59,7 +59,7 @@ class ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire9547ff6cdaa100988ae7e917f5492b78($fileIdentifier, $file)
|
||||
function composerRequire81e22985df5c50b3b6f7475a70999719($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit9547ff6cdaa100988ae7e917f5492b78
|
||||
class ComposerStaticInit81e22985df5c50b3b6f7475a70999719
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
@ -3867,9 +3867,9 @@ class ComposerStaticInit9547ff6cdaa100988ae7e917f5492b78
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit9547ff6cdaa100988ae7e917f5492b78::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit9547ff6cdaa100988ae7e917f5492b78::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit9547ff6cdaa100988ae7e917f5492b78::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit81e22985df5c50b3b6f7475a70999719::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit81e22985df5c50b3b6f7475a70999719::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit81e22985df5c50b3b6f7475a70999719::$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('RectorPrefix20220117\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78', false) && !interface_exists('ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78', false) && !trait_exists('ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78', false)) {
|
||||
spl_autoload_call('RectorPrefix20220117\ComposerAutoloaderInit9547ff6cdaa100988ae7e917f5492b78');
|
||||
if (!class_exists('ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719', false) && !interface_exists('ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719', false) && !trait_exists('ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719', false)) {
|
||||
spl_autoload_call('RectorPrefix20220117\ComposerAutoloaderInit81e22985df5c50b3b6f7475a70999719');
|
||||
}
|
||||
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('RectorPrefix20220117\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
@ -71,9 +71,9 @@ if (!function_exists('print_node')) {
|
||||
return \RectorPrefix20220117\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire9547ff6cdaa100988ae7e917f5492b78')) {
|
||||
function composerRequire9547ff6cdaa100988ae7e917f5492b78() {
|
||||
return \RectorPrefix20220117\composerRequire9547ff6cdaa100988ae7e917f5492b78(...func_get_args());
|
||||
if (!function_exists('composerRequire81e22985df5c50b3b6f7475a70999719')) {
|
||||
function composerRequire81e22985df5c50b3b6f7475a70999719() {
|
||||
return \RectorPrefix20220117\composerRequire81e22985df5c50b3b6f7475a70999719(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user