Open SebastianSimon opened 4 months ago
Thank you for reporting @SebastianSimon.
It's an interesting case, from the example I can see that original class have no doc-block at all. Can you confirm the library method you are referencing to also had no doc-block?
Current behaviour
The inspection hint “[EA] 'isEmpty' method can be dropped, as it only calls parent's one.” is triggered for derived methods that introduce a PHPDoc comment that changes semantics of the base method. In this example,
@phpstan-impure
is needed because PHPStan has a heuristic whereisEmpty
is assumed to be a pure getter, but it’s clearly not pure. Can’t modify the base class because it’s part of a libraryExpected behaviour
The Senseless proxy function inspection should probably ignore derived methods with a PHPDoc comment.
Environment details