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\DependencyInjection\Compiler; Chris@0: Chris@0: use Symfony\Component\DependencyInjection\ContainerBuilder; Chris@0: Chris@0: /** Chris@0: * Removes abstract Definitions. Chris@0: */ Chris@0: class RemoveAbstractDefinitionsPass implements CompilerPassInterface Chris@0: { Chris@0: /** Chris@0: * Removes abstract definitions from the ContainerBuilder. Chris@0: * Chris@0: * @param ContainerBuilder $container Chris@0: */ Chris@0: public function process(ContainerBuilder $container) Chris@0: { Chris@0: $compiler = $container->getCompiler(); Chris@0: $formatter = $compiler->getLoggingFormatter(); Chris@0: Chris@0: foreach ($container->getDefinitions() as $id => $definition) { Chris@0: if ($definition->isAbstract()) { Chris@0: $container->removeDefinition($id); Chris@0: $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'abstract')); Chris@0: } Chris@0: } Chris@0: } Chris@0: }