Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpKernel\DependencyInjection; Chris@0: Chris@0: /** Chris@0: * Resets provided services. Chris@0: * Chris@0: * @author Alexander M. Turek Chris@0: * @author Nicolas Grekas Chris@0: * Chris@0: * @internal Chris@0: */ Chris@0: class ServicesResetter Chris@0: { Chris@0: private $resettableServices; Chris@0: private $resetMethods; Chris@0: Chris@0: public function __construct(\Traversable $resettableServices, array $resetMethods) Chris@0: { Chris@0: $this->resettableServices = $resettableServices; Chris@0: $this->resetMethods = $resetMethods; Chris@0: } Chris@0: Chris@0: public function reset() Chris@0: { Chris@0: foreach ($this->resettableServices as $id => $service) { Chris@0: $service->{$this->resetMethods[$id]}(); Chris@0: } Chris@0: } Chris@0: }