Warning on unit testing to use explicit return types

Created on 21 August 2023, over 1 year ago
Updated 1 September 2023, over 1 year ago

Problem/Motivation

Geting the following error while doing unit testing:

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

Steps to reproduce

Install the module. run unit test:
ddev exec vendor/bin/phpunit -c core modules/contrib/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php

Proposed resolution

Fix the warning.

📌 Task
Status

Closed: duplicate

Version

1.8

Component

Code

Created by

🇮🇳India mukhtarm

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

Comments & Activities

Production build 0.71.5 2024