diff --git a/rules/TypeDeclaration/PHPStan/ObjectTypeSpecifier.php b/rules/TypeDeclaration/PHPStan/ObjectTypeSpecifier.php index 3c865a489ef..d06621b47bc 100644 --- a/rules/TypeDeclaration/PHPStan/ObjectTypeSpecifier.php +++ b/rules/TypeDeclaration/PHPStan/ObjectTypeSpecifier.php @@ -52,6 +52,10 @@ final class ObjectTypeSpecifier */ 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) { @@ -61,10 +65,6 @@ final class ObjectTypeSpecifier 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); } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 5586d7d5cb2..4b455b69753 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -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 */