has('rule_engine.autocomplete')) { return; } $dataSources = []; $dataSourceServices = $container->findTaggedServiceIds('rule_engine.autocomplete.data_source'); foreach ($dataSourceServices as $serviceId => $tags) { foreach ($tags as $attributes) { $dataSourceKey = $attributes['key']; if (isset($dataSources[$dataSourceKey])) { throw new LogicException(sprintf('Duplicate data source key "%s" found!', $dataSourceKey)); } $dataSources[$dataSourceKey] = new Reference($serviceId); continue 2; } } $definition = $container->findDefinition('rule_engine.autocomplete'); $definition->setArguments([$dataSources]); } }