Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / vendor / drush / drush / src / Symfony / BootstrapCompilerPass.php
1 <?php
2
3 namespace Drush\Symfony;
4
5 use Symfony\Component\DependencyInjection\ContainerBuilder;
6 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7 use Symfony\Component\DependencyInjection\Reference;
8
9 class BootstrapCompilerPass implements CompilerPassInterface
10 {
11     public function process(ContainerBuilder $container)
12     {
13         if (!$container->has('bootstrap.manager')) {
14             return;
15         }
16
17         $definition = $container->findDefinition(
18             'bootstrap.manager'
19         );
20
21         $taggedServices = $container->findTaggedServiceIds(
22             'bootstrap.boot'
23         );
24         foreach ($taggedServices as $id => $tags) {
25             $definition->addMethodCall(
26                 'add',
27                 [new Reference($id)]
28             );
29         }
30     }
31 }