use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Reference;
9
10
class ExtractorPass implements CompilerPassInterface
11
{
12
public function process(ContainerBuilder $container)
13
{
14
$extractors = array();
15
16
foreach ($container->findTaggedServiceIds('incenteev_translation_checker.extractor') as $id => $tags) {
17
$extractors[] = new Reference($id);
18
}
19
20
// If there is only one configured extractor, skip the chain one
21
if (1 === count($extractors)) {
22
$container->setAlias('incenteev_translation_checker.extractor', new Alias((string) $extractors[0], $container->getAlias('incenteev_translation_checker.extractor')->isPublic()));