Add 'array' return type in Drupal\entity\EventSubscriber\EntityDuplicateSubscriber

Created on 2 August 2024, about 2 months ago
Updated 25 August 2024, 22 days ago

Problem/Motivation

When using this module in tests at 10.3+ we get the deprecation message

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

Entity API is a dependency from Commerce module, and hence also needed when testing modules which integrate with Commerce

Steps to reproduce

See Scheduler MR161 which fixes the Scheduler test eventsubscriber. However, the pipelines still have many deprecations due to Entity API
https://git.drupalcode.org/project/scheduler/-/jobs/2301653#L482

Proposed resolution

Add array return type in the definition of EntityDuplicateSubscriber()

📌 Task
Status

Fixed

Version

1.0

Component

Code - misc

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