Open
Description
Bug report
I am returning a class-string from a method which could also return null in the default generic case (using a conditional return type declaration). The returned class-string type is not checked in the context of the child class but in the generic context of the parent/definer and thus not part of the generic template variable.
Code snippet that reproduces the problem
https://phpstan.org/r/ea335711-73a7-4d4e-9647-9212eef29f75
Expected output
This code shouldn't have any issues as DeleteActionType implements DataClassAwareFormTypeInterface<DeleteActionParameters>
and DeleteActionParameters
is of Struct
Did PHPStan help you today? Did it make you happy in any way?
Most of the time, PHPStan is more intelligent than I am - discovering issues with covariance and contravariance I otherwise would've missed :)