Skip to content

Commit a20a60c

Browse files
committed
Updated Rector to commit 4bdbb1fbd520b0b7da6b4decd07fa2f734967c5e
rectorphp/rector-src@4bdbb1f Revert " [AutoImport] Allow on FQCN current same class (#7232)" (#7233)
1 parent 06060a6 commit a20a60c

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

rules/CodingStyle/Node/NameImporter.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use PhpParser\Node\Name\FullyQualified;
99
use PhpParser\Node\Stmt\GroupUse;
1010
use PhpParser\Node\Stmt\Use_;
11-
use PHPStan\Analyser\Scope;
1211
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipper;
1312
use Rector\Naming\Naming\AliasNameResolver;
1413
use Rector\NodeTypeResolver\Node\AttributeKey;
@@ -91,11 +90,6 @@ private function importNameAndCollectNewUseStatement(File $file, FullyQualified
9190
$nameInUse->setAttribute(AttributeKey::NAMESPACED_NAME, $fullyQualified->toString());
9291
return $nameInUse;
9392
}
94-
$nameInNamespacedScope = $this->resolveNameInNamespacedScope($fullyQualified);
95-
if ($nameInNamespacedScope instanceof Name) {
96-
$nameInNamespacedScope->setAttribute(AttributeKey::NAMESPACED_NAME, $fullyQualified->toString());
97-
return $nameInNamespacedScope;
98-
}
9993
// the same end is already imported → skip
10094
if ($this->classNameImportSkipper->shouldSkipNameForFullyQualifiedObjectType($file, $fullyQualified, $fullyQualifiedObjectType)) {
10195
return null;
@@ -109,29 +103,6 @@ private function importNameAndCollectNewUseStatement(File $file, FullyQualified
109103
$this->addUseImport($file, $fullyQualified, $fullyQualifiedObjectType);
110104
return $fullyQualifiedObjectType->getShortNameNode();
111105
}
112-
private function resolveNameInNamespacedScope(FullyQualified $fullyQualified): ?Name
113-
{
114-
/**
115-
* Note: Don't use ScopeFetcher::fetch() on Name instance,
116-
* Scope can be null on Name
117-
* This is part of ScopeAnalyzer::NON_REFRESHABLE_NODES
118-
* @see https://github.com/rectorphp/rector-src/blob/9929af7c0179929b4fde6915cb7a06c3141dde6c/src/NodeAnalyzer/ScopeAnalyzer.php#L17
119-
*/
120-
$scope = $fullyQualified->getAttribute(AttributeKey::SCOPE);
121-
if (!$scope instanceof Scope) {
122-
return null;
123-
}
124-
$namespace = $scope->getNamespace();
125-
if ($namespace === null) {
126-
return null;
127-
}
128-
$shortName = $fullyQualified->getLast();
129-
$namepaceFullyQualifiedName = substr($fullyQualified->toString(), 0, -strlen($shortName) - 1);
130-
if ($namepaceFullyQualifiedName === $namespace) {
131-
return new Name($shortName);
132-
}
133-
return null;
134-
}
135106
private function addUseImport(File $file, FullyQualified $fullyQualified, FullyQualifiedObjectType $fullyQualifiedObjectType): void
136107
{
137108
if ($this->useNodesToAddCollector->hasImport($file, $fullyQualified, $fullyQualifiedObjectType)) {

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'e6147302c82deab984e36f25ca2ab39958771d95';
22+
public const PACKAGE_VERSION = '4bdbb1fbd520b0b7da6b4decd07fa2f734967c5e';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-09-10 00:40:30';
27+
public const RELEASE_DATE = '2025-09-10 04:26:09';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)