Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / src / Symfony / BootstrapCompilerPass.php
diff --git a/vendor/drush/drush/src/Symfony/BootstrapCompilerPass.php b/vendor/drush/drush/src/Symfony/BootstrapCompilerPass.php
new file mode 100644 (file)
index 0000000..11f0b97
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drush\Symfony;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\Reference;
+
+class BootstrapCompilerPass implements CompilerPassInterface
+{
+    public function process(ContainerBuilder $container)
+    {
+        if (!$container->has('bootstrap.manager')) {
+            return;
+        }
+
+        $definition = $container->findDefinition(
+            'bootstrap.manager'
+        );
+
+        $taggedServices = $container->findTaggedServiceIds(
+            'bootstrap.boot'
+        );
+        foreach ($taggedServices as $id => $tags) {
+            $definition->addMethodCall(
+                'add',
+                [new Reference($id)]
+            );
+        }
+    }
+}