Fix false positive of access to static private property of parent class#1989
Fix false positive of access to static private property of parent class#1989ondrejmirtes merged 6 commits intophpstan:1.9.xfrom
Conversation
|
just realized that this rule also missed a separate error case, which the phpstan-src/src/Rules/Properties/AccessPropertiesRule.php Lines 124 to 135 in 80ba5a0 added the missing check and a test |
|
This pull request has been marked as ready for review. |
There was a problem hiding this comment.
- typeForDescribe is just for error message description
instanceof *Typeis always wrong
There was a problem hiding this comment.
refactored it to make it more like
phpstan-src/src/Rules/Properties/AccessPropertiesRule.php
Lines 119 to 139 in 582a9cb
There was a problem hiding this comment.
This is also wrong. getReferencedClasses will return nested classes too. Which means that if you get Foo<Bar>, getReferencedClasses will contain both Foo and Bar.
I think that in context of this PR, you need TypeUtils::getDirectClassNames. Feel free to fix the other PR too.
There was a problem hiding this comment.
at this point I just did what you said. I don't know what I am doing here right now.
Feel free to fix the other PR too.
not sure which one you mean.
I will be in a meeting for the rest of the day. would be great in case you already know what needs to be done, if you could finish it.
thank you
There was a problem hiding this comment.
You said: refactored it to make it more like
phpstan-src/src/Rules/Properties/AccessPropertiesRule.php
Lines 119 to 139 in 582a9cb
But that other rule is wrong too, not sure for how long.
There was a problem hiding this comment.
ok. I pushed a fix. hopefully thats what you had in mind.
thank you
There was a problem hiding this comment.
But that other rule is wrong too, not sure for how long.
btw: I found the commit staabm@455fb7b
|
Thank you! |
closes phpstan/phpstan#8333