Updated Rector to commit 6cc42eb33187a9b77357c1f459d724c8aa1eb4f7

6cc42eb331 [StaticTypeMapper] Remove parent attribute usage on FullyQualifiedObjectType (#4347)
This commit is contained in:
Tomas Votruba 2023-06-25 17:06:09 +00:00
parent f7561073a3
commit ebab7418f4
7 changed files with 18 additions and 19 deletions

View File

@ -9,6 +9,7 @@ use PhpParser\Node\Stmt\UseUse;
use PHPStan\Type\ObjectType; use PHPStan\Type\ObjectType;
use PHPStan\Type\Type; use PHPStan\Type\Type;
use PHPStan\Type\TypeWithClassName; use PHPStan\Type\TypeWithClassName;
use Rector\NodeTypeResolver\Node\AttributeKey;
/** /**
* @api * @api
*/ */
@ -31,6 +32,7 @@ final class AliasedObjectType extends ObjectType
public function getUseNode() : Use_ public function getUseNode() : Use_
{ {
$name = new Name($this->fullyQualifiedClass); $name = new Name($this->fullyQualifiedClass);
$name->setAttribute(AttributeKey::IS_USEUSE_NAME, \true);
$useUse = new UseUse($name, $this->getClassName()); $useUse = new UseUse($name, $this->getClassName());
return new Use_([$useUse]); return new Use_([$useUse]);
} }
@ -48,6 +50,7 @@ final class AliasedObjectType extends ObjectType
public function getFunctionUseNode() : Use_ public function getFunctionUseNode() : Use_
{ {
$name = new Name($this->fullyQualifiedClass); $name = new Name($this->fullyQualifiedClass);
$name->setAttribute(AttributeKey::IS_USEUSE_NAME, \true);
$useUse = new UseUse($name, $this->getClassName()); $useUse = new UseUse($name, $this->getClassName());
$use = new Use_([$useUse]); $use = new Use_([$useUse]);
$use->type = Use_::TYPE_FUNCTION; $use->type = Use_::TYPE_FUNCTION;

View File

@ -45,15 +45,15 @@ final class FullyQualifiedObjectType extends ObjectType
public function getUseNode() : Use_ public function getUseNode() : Use_
{ {
$name = new Name($this->getClassName()); $name = new Name($this->getClassName());
$name->setAttribute(AttributeKey::IS_USEUSE_NAME, \true);
$useUse = new UseUse($name); $useUse = new UseUse($name);
$name->setAttribute(AttributeKey::PARENT_NODE, $useUse);
return new Use_([$useUse]); return new Use_([$useUse]);
} }
public function getFunctionUseNode() : Use_ public function getFunctionUseNode() : Use_
{ {
$name = new Name($this->getClassName()); $name = new Name($this->getClassName());
$name->setAttribute(AttributeKey::IS_USEUSE_NAME, \true);
$useUse = new UseUse($name, null); $useUse = new UseUse($name, null);
$name->setAttribute(AttributeKey::PARENT_NODE, $useUse);
$use = new Use_([$useUse]); $use = new Use_([$useUse]);
$use->type = Use_::TYPE_FUNCTION; $use->type = Use_::TYPE_FUNCTION;
return $use; return $use;

View File

@ -4,7 +4,6 @@ declare (strict_types=1);
namespace Rector\CodingStyle\Node; namespace Rector\CodingStyle\Node;
use PhpParser\Node\Name; use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\GroupUse; use PhpParser\Node\Stmt\GroupUse;
use PhpParser\Node\Stmt\Use_; use PhpParser\Node\Stmt\Use_;
use Rector\CodingStyle\ClassNameImport\AliasUsesResolver; use Rector\CodingStyle\ClassNameImport\AliasUsesResolver;
@ -133,10 +132,7 @@ final class NameImporter
if ($name->getAttribute(AttributeKey::IS_NAMESPACE_NAME) === \true) { if ($name->getAttribute(AttributeKey::IS_NAMESPACE_NAME) === \true) {
return \true; return \true;
} }
if ($name->getAttribute(AttributeKey::IS_USEUSE_NAME) === \true) { return $name->getAttribute(AttributeKey::IS_USEUSE_NAME) === \true;
return \true;
}
return !$name instanceof FullyQualified;
} }
private function isFunctionOrConstantImportWithSingleName(Name $name) : bool private function isFunctionOrConstantImportWithSingleName(Name $name) : bool
{ {

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = 'beca17df3f02d9a2a7800e9b238bac3b9c862498'; public const PACKAGE_VERSION = '6cc42eb33187a9b77357c1f459d724c8aa1eb4f7';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2023-06-25 23:48:32'; public const RELEASE_DATE = '2023-06-26 00:02:05';
/** /**
* @var int * @var int
*/ */

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit6c9499dd0d9c07b7ba7975b1e0a97662::getLoader(); return ComposerAutoloaderInit63c0cd1f8e04b29f96bbff647001340d::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit6c9499dd0d9c07b7ba7975b1e0a97662 class ComposerAutoloaderInit63c0cd1f8e04b29f96bbff647001340d
{ {
private static $loader; private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit6c9499dd0d9c07b7ba7975b1e0a97662
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit6c9499dd0d9c07b7ba7975b1e0a97662', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit63c0cd1f8e04b29f96bbff647001340d', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit6c9499dd0d9c07b7ba7975b1e0a97662', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit63c0cd1f8e04b29f96bbff647001340d', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6c9499dd0d9c07b7ba7975b1e0a97662::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit63c0cd1f8e04b29f96bbff647001340d::getInitializer($loader));
$loader->setClassMapAuthoritative(true); $loader->setClassMapAuthoritative(true);
$loader->register(true); $loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit6c9499dd0d9c07b7ba7975b1e0a97662::$files; $filesToLoad = \Composer\Autoload\ComposerStaticInit63c0cd1f8e04b29f96bbff647001340d::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) { $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit6c9499dd0d9c07b7ba7975b1e0a97662 class ComposerStaticInit63c0cd1f8e04b29f96bbff647001340d
{ {
public static $files = array ( public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3091,9 +3091,9 @@ class ComposerStaticInit6c9499dd0d9c07b7ba7975b1e0a97662
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit6c9499dd0d9c07b7ba7975b1e0a97662::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit63c0cd1f8e04b29f96bbff647001340d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6c9499dd0d9c07b7ba7975b1e0a97662::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit63c0cd1f8e04b29f96bbff647001340d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6c9499dd0d9c07b7ba7975b1e0a97662::$classMap; $loader->classMap = ComposerStaticInit63c0cd1f8e04b29f96bbff647001340d::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }