phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

Support for native return type missing from parent @return tag

Open shyim opened this issue 1 year ago • 0 comments

The EventSubscriberInterface from Symfony has an @return annotation, and all classes that implement it and have no native return type get a deprecation error message.

class Foo implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
}
}
Method "Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()" might add "array" as a native return type declaration in the future. Do the same in implementation "Foo" now to avoid errors or add an explicit @return annotation to suppress this message.

It would be nice if we could get the error in PHPStan instead of running the actual application :)

shyim avatar Oct 07 '24 10:10 shyim