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 staabm marked this pull request as ready for review

February 19, 2026 15:35

VincentLanglet

@staabm