Skip to content
Snippets Groups Projects
Verified Commit 1036f4cc authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3029197 by catch, Gábor Hojtsy, alexpott, mikelutz: [symfony 5] Class...

Issue #3029197 by catch, Gábor Hojtsy, alexpott, mikelutz: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead
parent 84a06d6b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace Drupal\Component\DependencyInjection; namespace Drupal\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ResettableContainerInterface;
use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Exception\RuntimeException;
...@@ -42,9 +41,12 @@ ...@@ -42,9 +41,12 @@
* - The function getServiceIds() was added as it has a use-case in core and * - The function getServiceIds() was added as it has a use-case in core and
* contrib. * contrib.
* *
* @todo Implement Symfony\Contracts\Service\ResetInterface once Symfony 4
* is being used. See https://www.drupal.org/project/drupal/issues/3032605
*
* @ingroup container * @ingroup container
*/ */
class Container implements ContainerInterface, ResettableContainerInterface { class Container implements ContainerInterface {
/** /**
* The parameters of the container. * The parameters of the container.
...@@ -187,7 +189,12 @@ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_IN ...@@ -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() { public function reset() {
if (!empty($this->scopedServices)) { if (!empty($this->scopedServices)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment