Add 'array' return type in getSubscribedEvents()

Created on 1 August 2024, about 2 months ago
Updated 27 August 2024, 23 days ago

Problem/Motivation

PHPunit tests at Next Major give the following error:

Method "Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\scheduler_api_test\EventSubscriber" now to avoid errors or add an explicit @return annotation to suppress this message.

Triggered by: Drupal\Tests\scheduler\Functional\SchedulerEventsTest::testNodeEvents

Next Major (D11) composer shows symfony/event-dispatcher (v7.1.1)
Current and Next Minor (D10) composer jobs show symfony/event-dispatcher (v6.4.8)

Proposed resolution

Add return type hint array to the EventSubscriber definition

📌 Task
Status

Fixed

Version

2.0

Component

Coding Standards

Created by

🇬🇧United Kingdom jonathan1055

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024