Skip to content

Commit

Permalink
Updated Rector to commit b833a753cc1d999fe0e832367a83d48311e378b4
Browse files Browse the repository at this point in the history
rectorphp/rector-src@b833a75 [Performance] Early return FullyQualifiedObjectType on FQCN on ObjectTypeSpecifier (#6658)
  • Loading branch information
TomasVotruba committed Jan 6, 2025
1 parent bad8f38 commit 71cfadb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions rules/TypeDeclaration/PHPStan/ObjectTypeSpecifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public function __construct(ReflectionProvider $reflectionProvider, UseImportsRe
*/
public function narrowToFullyQualifiedOrAliasedObjectType(Node $node, ObjectType $objectType, ?\PHPStan\Analyser\Scope $scope, bool $withPreslash = \false)
{
$className = \ltrim($objectType->getClassName(), '\\');
if (\strncmp($objectType->getClassName(), '\\', \strlen('\\')) === 0) {
return new FullyQualifiedObjectType($className);
}
$uses = $this->useImportsResolver->resolve();
$aliasedObjectType = $this->matchAliasedObjectType($objectType, $uses);
if ($aliasedObjectType instanceof AliasedObjectType) {
Expand All @@ -61,10 +65,6 @@ public function narrowToFullyQualifiedOrAliasedObjectType(Node $node, ObjectType
if ($shortenedObjectType !== null) {
return $shortenedObjectType;
}
$className = \ltrim($objectType->getClassName(), '\\');
if (\strncmp($objectType->getClassName(), '\\', \strlen('\\')) === 0) {
return new FullyQualifiedObjectType($className);
}
if ($this->reflectionProvider->hasClass($className)) {
return new FullyQualifiedObjectType($className);
}
Expand Down
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 = '4b18c82b21ad76410037090b0bf4c019fa983f08';
public const PACKAGE_VERSION = 'b833a753cc1d999fe0e832367a83d48311e378b4';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2025-01-06 16:24:17';
public const RELEASE_DATE = '2025-01-07 01:04:32';
/**
* @var int
*/
Expand Down

0 comments on commit 71cfadb

Please sign in to comment.