From d003c38e7740fa99c367feda6522b4a9e82b92df Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Wed, 15 Apr 2020 12:59:47 +0100
Subject: [PATCH] =?UTF-8?q?Issue=20#3032605=20by=20mikelutz,=20G=C3=A1bor?=
 =?UTF-8?q?=20Hojtsy,=20longwave,=20martin107:=20[symfony=204]=20Drupal\Co?=
 =?UTF-8?q?mponent\DependencyInjection\Container=20should=20implement=20Sy?=
 =?UTF-8?q?mfony\Contracts\Service\ResetInterface?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

(cherry picked from commit d105f450b8aa94b1f849150351cb8c1977f72a43)
---
 core/lib/Drupal/Component/DependencyInjection/Container.php | 6 ++----
 core/lib/Drupal/Component/DependencyInjection/composer.json | 3 ++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/core/lib/Drupal/Component/DependencyInjection/Container.php b/core/lib/Drupal/Component/DependencyInjection/Container.php
index 9594b6c796ea..9eecff3eb31f 100644
--- a/core/lib/Drupal/Component/DependencyInjection/Container.php
+++ b/core/lib/Drupal/Component/DependencyInjection/Container.php
@@ -9,6 +9,7 @@
 use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
 use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
 use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Contracts\Service\ResetInterface;
 
 /**
  * Provides a container optimized for Drupal's needs.
@@ -41,12 +42,9 @@
  * - The function getServiceIds() was added as it has a use-case in core and
  *   contrib.
  *
- * @todo Implement Symfony\Contracts\Service\ResetInterface once Symfony 4
- *   is being used. See https://www.drupal.org/project/drupal/issues/3032605
- *
  * @ingroup container
  */
-class Container implements ContainerInterface {
+class Container implements ContainerInterface, ResetInterface {
 
   /**
    * The parameters of the container.
diff --git a/core/lib/Drupal/Component/DependencyInjection/composer.json b/core/lib/Drupal/Component/DependencyInjection/composer.json
index 771c5cc9ff0a..e370fa3ed783 100644
--- a/core/lib/Drupal/Component/DependencyInjection/composer.json
+++ b/core/lib/Drupal/Component/DependencyInjection/composer.json
@@ -12,7 +12,8 @@
   },
   "require": {
     "php": ">=7.3.0",
-    "symfony/dependency-injection": "^4.4"
+    "symfony/dependency-injection": "^4.4",
+    "symfony/service-contracts": "^1.1|^2"
   },
   "suggest": {
     "symfony/expression-language": "For using expressions in service container configuration"
-- 
GitLab