Skip to content

Commit 376c016

Browse files
committed
remove unnecessary BC coverage from generic type alias resolution
1 parent 703a9a8 commit 376c016

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/PhpDoc/TypeNodeResolver.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -832,14 +832,8 @@ static function (string $variance): TemplateTypeVariance {
832832
}
833833

834834
// Check for a generic type alias (e.g. MyList<string>) before falling through to
835-
// class-based generic resolution, but only when the name is not itself a resolvable
836-
// class — in that case the class-based path must win to preserve backward compatibility
837-
// (a type alias like BelongsTo<T, U> = \Eloquent\BelongsTo<T, U> should still produce
838-
// the same GenericObjectType that class-based resolution would have given).
839-
$resolvedGenericName = $nameScope->resolveStringName($typeNode->type->name);
840-
$genericTypeAlias = !$this->getReflectionProvider()->hasClass($resolvedGenericName)
841-
? $this->findGenericTypeAlias($typeNode->type->name, $nameScope)
842-
: null;
835+
// class-based generic resolution.
836+
$genericTypeAlias = $this->findGenericTypeAlias($typeNode->type->name, $nameScope);
843837
if ($genericTypeAlias !== null) {
844838
$templateNodes = $genericTypeAlias->getTemplateTagValueNodes();
845839
$totalParams = count($templateNodes);

0 commit comments

Comments
 (0)