Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect deprecated Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array #679

Open
joachim-n opened this issue Dec 5, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@joachim-n
Copy link

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 {
@joachim-n joachim-n added the enhancement New feature or request label Dec 5, 2023
@joachim-n
Copy link
Author

This also happened with classes that implement EventSubscriberInterface without a base class.

@mglaman
Copy link
Owner

mglaman commented Dec 5, 2023

This should have been caught by PHPStan at level 2. I thought.

@joachim-n
Copy link
Author

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.

@mglaman
Copy link
Owner

mglaman commented Dec 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants