Skip to content

Commit

Permalink
Updated Rector to commit 0c368224b325087933f286a8e19be972b1ac85ae
Browse files Browse the repository at this point in the history
rectorphp/rector-src@0c36822 [AutoImport] Handle inner with sub namespace on auto import (#6679)
  • Loading branch information
TomasVotruba committed Jan 18, 2025
1 parent 906a4e3 commit 328512f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions rules/CodingStyle/Application/UseImportsAdder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
declare (strict_types=1);
namespace Rector\CodingStyle\Application;

use RectorPrefix202501\Nette\Utils\Strings;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Declare_;
use PhpParser\Node\Stmt\GroupUse;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Nop;
use PhpParser\Node\Stmt\Use_;
use PHPStan\Type\ObjectType;
use Rector\CodingStyle\ClassNameImport\UsedImportsResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
Expand Down Expand Up @@ -179,12 +177,15 @@ private function getNamespaceName(Namespace_ $namespace) : ?string
}
return $namespace->name->toString();
}
private function isCurrentNamespace(string $namespaceName, ObjectType $objectType) : bool
/**
* @param \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType|\Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType $objectType
*/
private function isCurrentNamespace(string $namespaceName, $objectType) : bool
{
$afterCurrentNamespace = Strings::after($objectType->getClassName(), $namespaceName . '\\');
if ($afterCurrentNamespace === null) {
$className = $objectType->getClassName();
if (\strncmp($className, $namespaceName . '\\', \strlen($namespaceName . '\\')) !== 0) {
return \false;
}
return $namespaceName . '\\' . $afterCurrentNamespace === $objectType->getClassName();
return $namespaceName . '\\' . $objectType->getShortName() === $className;
}
}
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '71534e3d67fec9421bab21cecff2385a4bfefc1b';
public const PACKAGE_VERSION = '0c368224b325087933f286a8e19be972b1ac85ae';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2025-01-18 16:44:19';
public const RELEASE_DATE = '2025-01-19 02:25:31';
/**
* @var int
*/
Expand Down

0 comments on commit 328512f

Please sign in to comment.