Fix #11463: Using phpstan-import-type between classes makes alias unresolvable by staabm · Pull Request #4997 · phpstan/phpstan-src
and others added 3 commits
February 19, 2026 16:28…solvable - When two classes have mutual @phpstan-import-type tags (FooType imports Bar from BarType, BarType imports Foo from FooType), the circular detection in ClassReflection::getTypeAliases() was too aggressive - The fix returns local type aliases (defined via @phpstan-type) when circular import resolution is detected, since local aliases don't depend on imports - Added regression test in tests/PHPStan/Rules/PhpDoc/data/bug-11463.php Closes phpstan/phpstan#11463
staabm
marked this pull request as ready for review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters