From 1036f4cca0a7c16da06d50a527247c54fb43afcf Mon Sep 17 00:00:00 2001 From: Lee Rowlands <lee.rowlands@previousnext.com.au> Date: Wed, 6 Mar 2019 10:57:52 +1000 Subject: [PATCH] =?UTF-8?q?Issue=20#3029197=20by=20catch,=20G=C3=A1bor=20H?= =?UTF-8?q?ojtsy,=20alexpott,=20mikelutz:=20[symfony=205]=20Class=20implem?= =?UTF-8?q?ents=20"Symfony\Component\DependencyInjection\ResettableContain?= =?UTF-8?q?erInterface"=20that=20is=20deprecated=20since=20Symfony=204.2,?= =?UTF-8?q?=20use=20"Symfony\Contracts\Service\ResetInterface"=20instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/DependencyInjection/Container.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/lib/Drupal/Component/DependencyInjection/Container.php b/core/lib/Drupal/Component/DependencyInjection/Container.php index 008c6f5cd4af..63214828bfe3 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Container.php +++ b/core/lib/Drupal/Component/DependencyInjection/Container.php @@ -3,7 +3,6 @@ namespace Drupal\Component\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ResettableContainerInterface; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; @@ -42,9 +41,12 @@ * - 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, ResettableContainerInterface { +class Container implements ContainerInterface { /** * The parameters of the container. @@ -187,7 +189,12 @@ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_IN } /** - * {@inheritdoc} + * Resets shared services from the container. + * + * The container is not intended to be used again after being reset in a + * normal workflow. This method is meant as a way to release references for + * ref-counting. A subsequent call to ContainerInterface::get() will recreate + * a new instance of the shared service. */ public function reset() { if (!empty($this->scopedServices)) { -- GitLab