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