Fix string type hints to Container getters for PHP 8.5

Created on 20 October 2025, 8 days ago

Problem/Motivation

Split from 📌 Deal with NULL as array key/offset Needs work

Steps to reproduce

5) /builds/issue/drupal-3523596/core/lib/Drupal/Component/DependencyInjection/Container.php:150
Using null as an array offset is deprecated, use an empty string instead
Triggered by:
* Drupal\Tests\Component\DependencyInjection\ContainerTest::testGetForNonExistentNULLService
  /builds/issue/drupal-3523596/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php:369
* Drupal\Tests\Component\DependencyInjection\PhpArrayContainerTest::testGetForNonExistentNULLService
  /builds/issue/drupal-3523596/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php:369

Proposed resolution

add string type hint as interface ContainerInterface extends PsrContainerInterface declares at

Remaining tasks

part, review,commit

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Needs review

Version

11.0 🔥

Component

base system

Created by

🇫🇷France andypost

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024