You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Situation: Parent class with return $this in a Setter. Then instantiate an object of a child class, call the setter, then some other method of the child class.
The root of the problem seems to be the return type self (line 6). phpstan obviously interprets this as ParentClass, not as Child
The text was updated successfully, but these errors were encountered:
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
BTW: Did you know that PHPStan now has a brand new website with a user guide, guide to writing analyser-friendly PHP code, and a guide to developing PHPStan extensions? Visit phpstan.org today!
lockbot
locked as resolved and limited conversation to collaborators
May 5, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Probably the same as #2874
phpstan/phpstan 0.12.18
Code snippet that reproduces the problem
https://phpstan.org/r/21d50449-fe46-45db-bf63-c5659fc13147
Situation: Parent class with
return $this
in a Setter. Then instantiate an object of a child class, call the setter, then some other method of the child class.The root of the problem seems to be the return type
self
(line 6). phpstan obviously interprets this asParentClass
, not asChild
The text was updated successfully, but these errors were encountered: