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