src/DependencyInjection/Compiler/ConfigSourcePass.php
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('fos_elastica.config_manager')) {
            return;
        }

        $indexSources = [];
        $indexTemplateSources = [];
        foreach (array_keys($container->findTaggedServiceIds('fos_elastica.config_source')) as $id) {
            $tag = $container->findDefinition($id)->getTag('fos_elastica.config_source');
            if (isset($tag[0]['source']) && $tag[0]['source'] === self::SOURCE_TYPE_INDEX_TEMPLATE) {
                $indexTemplateSources[] = new Reference($id);
            } else {
                $indexSources[] = new Reference($id);
            }
        }

        $container->getDefinition('fos_elastica.config_manager')->replaceArgument(0, $indexSources);
        $container->getDefinition('fos_elastica.config_manager.index_templates')->replaceArgument(0, $indexTemplateSources);
    }
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('fos_elastica.config_manager')) {
            return;
        }

        $indexSources = [];
        $indexTemplateSources = [];
        foreach (array_keys($container->findTaggedServiceIds('fos_elastica.config_source')) as $id) {
            $tag = $container->findDefinition($id)->getTag('fos_elastica.config_source');
            if (isset($tag[0]['source']) && $tag[0]['source'] === self::SOURCE_TYPE_INDEX_TEMPLATE) {
                $indexTemplateSources[] = new Reference($id);
            } else {
                $indexSources[] = new Reference($id);
            }
        }

        $container->getDefinition('fos_elastica.config_manager')->replaceArgument(0, $indexSources);
        $container->getDefinition('fos_elastica.config_manager.index_templates')->replaceArgument(0, $indexTemplateSources);
    }
{@inheritdoc}