PHPUnit warnings: return types and NULL values

Created on 23 February 2024, about 1 year ago
Updated 16 March 2024, 12 months ago

Problem/Motivation

I've begun running PHPUnit reports on our site and these related to the Feeds module appeared in the report:

1x: Method "Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer()" might add "void" as a native return type declaration in the future. Do the same in implementation "Drupal\feeds\Component\ZfExtensionManagerSfContainer" now to avoid errors or add an explicit @return annotation to suppress this message.
1x in SyndicationParserTest::setUp from Drupal\Tests\feeds\Unit\Feeds\Parser

1x: Method "Laminas\Feed\Reader\Extension\AbstractEntry::registerNamespaces()" might add "void" as a native return type declaration in the future. Do the same in child class "Drupal\feeds\Laminas\Extension\Georss\Entry" now to avoid errors or add an explicit @return annotation to suppress this message.
1x in SyndicationParserTest::setUp from Drupal\Tests\feeds\Unit\Feeds\Parser

1x: Method "Laminas\Feed\Reader\Extension\AbstractEntry::registerNamespaces()" might add "void" as a native return type declaration in the future. Do the same in child class "Drupal\feeds\Laminas\Extension\Mediarss\Entry" now to avoid errors or add an explicit @return annotation to suppress this message.
1x in SyndicationParserTest::setUp from Drupal\Tests\feeds\Unit\Feeds\Parser

1x: Deprecated NULL placeholder value for key (%site) in: "The feed from %site seems to be broken because of error "%error".". This will throw a PHP error in drupal:11.0.0. See https://www.drupal.org/node/3318826 β†’
1x in SyndicationParserTest::testInvalidFeed from Drupal\Tests\feeds\Unit\Feeds\Parser

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\feeds\EventSubscriber\AfterParseBase" now to avoid errors or add an explicit @return annotation to suppress this message.
1x in AfterParseBaseTest::setUp from Drupal\Tests\feeds\Unit\EventSubscriber

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\feeds\EventSubscriber\LazySubscriber" now to avoid errors or add an explicit @return annotation to suppress this message.
1x in LazySubscriberTest::testGetSubscribedEvents from Drupal\Tests\feeds\Unit\EventSubscriber

Steps to reproduce

Using the default phpunit.xml configuration, but updated for your path structure, run:

phpunit --testsuite="unit"

πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada ryanrobinson_wlu

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