Source of file InputProcessorHandler.php
Size: 1,446 Bytes - Last Modified: 2021-12-24T06:51:36+00:00
/var/www/docs.ssmods.com/process/src/src/DependencyInjection/CompilerPass/InputProcessorHandler.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | <?php /** * This file is part of the Heystack package * * @package Heystack */ /** * CompilerPass namespace */ namespace Heystack\Core\DependencyInjection\CompilerPass; use Heystack\Core\Services; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; /** * Merges extensions definition calls into the container builder. * * When there exists an extension which defines calls on an existing service, * this compiler pass will merge those calls without overwriting. * * @copyright Heyday * @author Glenn Bautista * @package Heystack */ class InputProcessorHandler implements CompilerPassInterface { /** * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container * @return void */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition(Services::INPUT_PROCESSOR_HANDLER)) { return; } $definition = $container->getDefinition(Services::INPUT_PROCESSOR_HANDLER); $taggedServices = $container->findTaggedServiceIds(Services::INPUT_PROCESSOR_HANDLER . '.processor'); foreach ($taggedServices as $id => $attributes) { $definition->addMethodCall( 'addProcessor', [new Reference($id)] ); } } } |