Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console-core / src / Command / Exclude / ElephpantCommand.php
index 8d15be4030b373ce564c8a85e1171845e25f1a8e..127ac36a9ce1345f66e7607b8189e444979f6d26 100644 (file)
@@ -9,11 +9,10 @@ namespace Drupal\Console\Core\Command\Exclude;
 
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Finder\Finder;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
+use Drupal\Console\Core\Command\Command;
 use Drupal\Console\Core\Utils\TwigRenderer;
-use Drupal\Console\Core\Style\DrupalStyle;
+use Drupal\Console\Core\Utils\ConfigurationManager;
 
 /**
  * Class ElephpantCommand
@@ -22,8 +21,6 @@ use Drupal\Console\Core\Style\DrupalStyle;
  */
 class ElephpantCommand extends Command
 {
-    use CommandTrait;
-
     /**
      * @var string
      */
@@ -35,17 +32,26 @@ class ElephpantCommand extends Command
     protected $renderer;
 
     /**
-     * DrupliconCommand constructor.
+     * @var ConfigurationManager
+     */
+    protected $configurationManager;
+
+
+    /**
+     * ElephpantCommand constructor.
      *
-     * @param string       $appRoot
-     * @param TwigRenderer $renderer
+     * @param string               $appRoot
+     * @param TwigRenderer         $renderer
+     * @param ConfigurationManager $configurationManager
      */
     public function __construct(
         $appRoot,
-        TwigRenderer $renderer
+        TwigRenderer $renderer,
+        ConfigurationManager $configurationManager
     ) {
         $this->appRoot = $appRoot;
         $this->renderer = $renderer;
+        $this->configurationManager = $configurationManager;
         parent::__construct();
     }
 
@@ -64,11 +70,9 @@ class ElephpantCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         $directory = sprintf(
             '%stemplates/core/elephpant/',
-            $this->appRoot . DRUPAL_CONSOLE_CORE
+            $this->configurationManager->getVendorCoreRoot()
         );
 
         $finder = new Finder();
@@ -89,7 +93,7 @@ class ElephpantCommand extends Command
             )
         );
 
-        $io->writeln($elephpant);
+        $this->getIo()->writeln($elephpant);
         return 0;
     }
 }