4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\DependencyInjection;
15 * Resets provided services.
17 * @author Alexander M. Turek <me@derrabus.de>
18 * @author Nicolas Grekas <p@tchwork.com>
22 class ServicesResetter
24 private $resettableServices;
25 private $resetMethods;
27 public function __construct(\Traversable $resettableServices, array $resetMethods)
29 $this->resettableServices = $resettableServices;
30 $this->resetMethods = $resetMethods;
33 public function reset()
35 foreach ($this->resettableServices as $id => $service) {
36 $service->{$this->resetMethods[$id]}();