Fix Stateful::_fromState return typehint
phpstan-strict-rules in projects using Stateful reports the following error:
Return type (MyStatefulClass) of method MyStatefulClass::_fromState() should be covariant with return type (static(Grifart\Stateful\Stateful)) of method Grifart\Stateful\Stateful::_fromState()
According to the reasoning here, this won't be fixed in PHPStan because with static
, there is actually no way to ensure that LSP can't be violated. I suggest sticking with self
which should be the way to go anyway once PHP 7.4 with covariant return types is released.