phpstan-drupal
phpstan-drupal copied to clipboard
Detect deprecated Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array
Feature request
I had a custom class that extended Drupal\Core\Routing\RouteSubscriberBase.
The old code had:
public static function getSubscribedEvents(): {
which was not compatible with D10 RouteSubscriberBase's
public static function getSubscribedEvents(): array {
This also happened with classes that implement EventSubscriberInterface without a base class.
This should have been caught by PHPStan at level 2. I thought.
I was using the Upgrade Status module -- sorry I don't know whether issues with deprecations should go on that module or here.
It didn't report any deprecations about getSubscribedEvents -- I had about 8 in total.
Ah yeah it does level nothing.
But even if it did, I forgot this wouldn't be caught. Because Symfony would still be old. So it's a valid thing to have and catch.
A forward checking return type rule.