Sulu\Bundle\MarkupBundle\DependencyInjection\CompilerPass\TagCompilerPass::process PHP Method

process() public method

public process ( ContainerBuilder $container )
$container Symfony\Component\DependencyInjection\ContainerBuilder
    public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(self::SERVICE_ID)) {
            return;
        }
        $references = [];
        foreach ($container->findTaggedServiceIds(self::TAG_NAME) as $id => $tags) {
            foreach ($tags as $attributes) {
                $type = $attributes[self::TYPE_ATTRIBUTE];
                $alias = $attributes[self::TAG_ATTRIBUTE];
                if (!array_key_exists($type, $references)) {
                    $references[$type] = [];
                }
                $references[$type][$alias] = new Reference($id);
            }
        }
        if (0 === count($references)) {
            return;
        }
        $container->getDefinition(self::SERVICE_ID)->replaceArgument(0, $references);
    }
TagCompilerPass