PHPDoc @return $this
on interface causes covariant error
#6462
Labels
Milestone
@return $this
on interface causes covariant error
#6462
Bug report
Adding
@return $this
to an interface function will cause PHPStan to report a covariant error, even though the$this
returned by the implementing class should satisfy.Code snippet that reproduces the problem
https://phpstan.org/r/a65e6de5-f29c-456d-8047-dda161734892
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
Absolutely! Caught some bugs in things I had mistyped as well as some logic flaws. So after fixing that code review was smooth sailing :D
The text was updated successfully, but these errors were encountered: