mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
Updated Rector to commit aac889be3d845974d3ab924ff7ad22784b9e3cb5
aac889be3d
[AutoImport] Remove unused compare removed use on FullyQualifiedNameClassNameImportSkipVoter (#5764)
This commit is contained in:
parent
bb8b99d70c
commit
e14c8a528b
@ -7,7 +7,6 @@ use RectorPrefix202403\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use Rector\CodingStyle\ClassNameImport\ShortNameResolver;
|
||||
use Rector\CodingStyle\Contract\ClassNameImport\ClassNameImportSkipVoterInterface;
|
||||
use Rector\Configuration\RenamedClassesDataCollector;
|
||||
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
|
||||
use Rector\ValueObject\Application\File;
|
||||
/**
|
||||
@ -26,15 +25,9 @@ final class FullyQualifiedNameClassNameImportSkipVoter implements ClassNameImpor
|
||||
* @var \Rector\CodingStyle\ClassNameImport\ShortNameResolver
|
||||
*/
|
||||
private $shortNameResolver;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Configuration\RenamedClassesDataCollector
|
||||
*/
|
||||
private $renamedClassesDataCollector;
|
||||
public function __construct(ShortNameResolver $shortNameResolver, RenamedClassesDataCollector $renamedClassesDataCollector)
|
||||
public function __construct(ShortNameResolver $shortNameResolver)
|
||||
{
|
||||
$this->shortNameResolver = $shortNameResolver;
|
||||
$this->renamedClassesDataCollector = $renamedClassesDataCollector;
|
||||
}
|
||||
public function shouldSkip(File $file, FullyQualifiedObjectType $fullyQualifiedObjectType, Node $node) : bool
|
||||
{
|
||||
@ -43,7 +36,6 @@ final class FullyQualifiedNameClassNameImportSkipVoter implements ClassNameImpor
|
||||
$shortNamesToFullyQualifiedNames = $this->shortNameResolver->resolveFromFile($file);
|
||||
$fullyQualifiedObjectTypeShortName = $fullyQualifiedObjectType->getShortName();
|
||||
$className = $fullyQualifiedObjectType->getClassName();
|
||||
$removedUses = $this->renamedClassesDataCollector->getOldClasses();
|
||||
foreach ($shortNamesToFullyQualifiedNames as $shortName => $fullyQualifiedName) {
|
||||
if ($fullyQualifiedObjectTypeShortName !== $shortName) {
|
||||
$shortName = $this->cleanShortName($shortName);
|
||||
@ -52,10 +44,7 @@ final class FullyQualifiedNameClassNameImportSkipVoter implements ClassNameImpor
|
||||
continue;
|
||||
}
|
||||
$fullyQualifiedName = \ltrim($fullyQualifiedName, '\\');
|
||||
if ($className === $fullyQualifiedName) {
|
||||
return \false;
|
||||
}
|
||||
return !\in_array($fullyQualifiedName, $removedUses, \true);
|
||||
return $className !== $fullyQualifiedName;
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'e3e741edd3ca55fc2c24c040f43c8974bda7e953';
|
||||
public const PACKAGE_VERSION = 'aac889be3d845974d3ab924ff7ad22784b9e3cb5';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-03-23 21:34:02';
|
||||
public const RELEASE_DATE = '2024-03-23 23:47:25';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user