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: * A pass to automatically process extensions if they implement Chris@0: * CompilerPassInterface. Chris@0: * Chris@0: * @author Wouter J Chris@0: */ Chris@0: class ExtensionCompilerPass implements CompilerPassInterface Chris@0: { Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function process(ContainerBuilder $container) Chris@0: { Chris@0: foreach ($container->getExtensions() as $extension) { Chris@0: if (!$extension instanceof CompilerPassInterface) { Chris@0: continue; Chris@0: } Chris@0: Chris@0: $extension->process($container); Chris@0: } Chris@0: } Chris@0: }