Return type declaration is incompatible with RouteSubscriberBase::getSubscribedEvents

Created on 21 June 2023, about 1 year ago

Problem/Motivation

Drupal 10 updates RouteSubscriberBase::getSubscribedEvents by declaring an array return type. Our route subscriber does not.
The result is the following error:

PHP Fatal error: Declaration of Drupal\tvi\EventSubscriber\RouteSubscriber::getSubscribedEvents() must be compatible with Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array in /app/web/modules/composer/tvi/src/EventSubscriber/RouteSubscriber.php on line 34

Steps to reproduce

Install the module on Drupal 10 and clear the caches. You should receive the above mentioned error.

Proposed resolution

Add the array return type declaration to Drupal\tvi\EventSubscriber\RouteSubscriber::getSubscribedEvents.

📌 Task
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇸🇮Slovenia gombi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gombi
  • Issue was unassigned.
  • Status changed to Closed: outdated about 1 year ago
  • 🇸🇮Slovenia gombi

    Turns out this was already done and I was checking out an outdated branch. Closing this as outdated. Sorry.

Production build 0.69.0 2024