Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drupal / console / src / Bootstrap / DrupalServiceModifier.php
index 9c563a5bed2d3d2ab9e07b0af66c852c4bb3ffd0..37d46213e0f24e044e7c75b68daaaefc033e2876 100644 (file)
@@ -4,6 +4,7 @@ namespace Drupal\Console\Bootstrap;
 
 use Drupal\Core\DependencyInjection\ServiceModifierInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Dflydev\DotAccessConfiguration\ConfigurationInterface;
 
 /**
  * Class DrupalServiceModifier
@@ -27,21 +28,26 @@ class DrupalServiceModifier implements ServiceModifierInterface
      */
     protected $generatorTag;
 
+    protected $configuration;
+
     /**
      * DrupalServiceModifier constructor.
      *
-     * @param string $root
-     * @param string $serviceTag
-     * @param string $generatorTag
+     * @param string                 $root
+     * @param string                 $serviceTag
+     * @param string                 $generatorTag
+     * @param ConfigurationInterface $configuration
      */
     public function __construct(
         $root = null,
         $serviceTag,
-        $generatorTag
+        $generatorTag,
+        $configuration
     ) {
         $this->root = $root;
         $this->commandTag = $serviceTag;
         $this->generatorTag = $generatorTag;
+        $this->configuration = $configuration;
     }
 
     /**
@@ -50,15 +56,7 @@ class DrupalServiceModifier implements ServiceModifierInterface
     public function alter(ContainerBuilder $container)
     {
         $container->addCompilerPass(
-            new DrupalCompilerPass()
+            new DrupalCompilerPass($this->configuration)
         );
-
-        //        $container->addCompilerPass(
-        //            new FindCommandsCompilerPass($this->commandTag)
-        //        );
-        //
-        //        $container->addCompilerPass(
-        //            new FindGeneratorsCompilerPass($this->generatorTag)
-        //        );
     }
 }