From dafe1f367f7e57e800fba5f1360e9973c8d176f9 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Thu, 14 Mar 2024 10:03:48 +0000
Subject: [PATCH] Issue #3427744 by longwave: Add void return to
 Drupal\Component\DependencyInjection\Container::reset()

---
 core/.deprecation-ignore.txt                                | 3 ---
 core/lib/Drupal/Component/DependencyInjection/Container.php | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/core/.deprecation-ignore.txt b/core/.deprecation-ignore.txt
index 1650f6f8a8b6..481aa1787a37 100644
--- a/core/.deprecation-ignore.txt
+++ b/core/.deprecation-ignore.txt
@@ -41,9 +41,6 @@
 %Expecting E_WARNING and E_USER_WARNING is deprecated and will no longer be possible in PHPUnit 10%
 %Expecting E_ERROR and E_USER_ERROR is deprecated and will no longer be possible in PHPUnit 10%
 
-# Symfony 7.
-%Method "Symfony\\Contracts\\Service\\ResetInterface::reset\(\)" might add "void" as a native return type declaration in the future. Do the same in implementation "Drupal\\Component\\DependencyInjection\\Container" now to avoid errors or add an explicit @return annotation to suppress this message.%
-
 # Temporarily for testing Symfony 6.4.
 %Since symfony/dependency-injection 6.4: "Symfony\\Component\\DependencyInjection\\ContainerAwareTrait" is deprecated, use dependency injection instead.%
 %The ".*" class uses "Symfony\\Component\\DependencyInjection\\ContainerAwareTrait" that is deprecated since Symfony 6.4, use dependency injection instead.%
diff --git a/core/lib/Drupal/Component/DependencyInjection/Container.php b/core/lib/Drupal/Component/DependencyInjection/Container.php
index 26b848896430..98507659379d 100644
--- a/core/lib/Drupal/Component/DependencyInjection/Container.php
+++ b/core/lib/Drupal/Component/DependencyInjection/Container.php
@@ -201,7 +201,7 @@ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_IN
    * ref-counting. A subsequent call to ContainerInterface::get() will recreate
    * a new instance of the shared service.
    */
-  public function reset() {
+  public function reset(): void {
     $this->services = [];
   }
 
-- 
GitLab