Repository navigation
Dectect reading class constants in PHPDoc - #2436
rvanvelzen wants to merge 1 commit into
Conversation
|
You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x. |
e0a1848 to
d898658
Compare
There was a problem hiding this comment.
I really like this, it's almost perfect. What gives me a little pause is that all PHPDocs are now parsed multiple times which would lead to performance problems. The correct way to access them is through FileTypeMapper. Also you shouldn't have to do any regexes, but correctly resolve the class name with NameScope.
Of course the issue is that the thing returned by FileTypeMapper is ResolvedPhpDocBlock. Which is about accessing the useful PHPDoc things like ParamTag and many others.
One way to solve this would be to add getClassConstFetches on ResolvedPhpDocBlock. But the class is a bit tricky to work with - because it can be created multiple ways (create, createEmpty, merge), we need to be careful every time a new property is added.
d898658 to
493aba4
Compare
493aba4 to
27d2535
Compare
27d2535 to
175c4e9
Compare
Fix phpstan/phpstan#6415, fix phpstan/phpstan#7184, fix phpstan/phpstan#9385