Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console-core / src / Command / Exec / ExecCommand.php
index 4b3f283f512e251deb73cc69e5ecbd8a6b26180b..958b4474d4febde1b3e50baf1e6ddcaaff32a644 100644 (file)
@@ -7,15 +7,13 @@
 
 namespace Drupal\Console\Core\Command\Exec;
 
-use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Process\ExecutableFinder;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
 use Drupal\Console\Core\Utils\ShellProcess;
-use Drupal\Console\Core\Style\DrupalStyle;
+use Drupal\Console\Core\Command\Command;
 
 /**
  * Class ExecCommand
@@ -24,8 +22,6 @@ use Drupal\Console\Core\Style\DrupalStyle;
  */
 class ExecCommand extends Command
 {
-    use CommandTrait;
-
     /**
      * @var ShellProcess
      */
@@ -67,12 +63,11 @@ class ExecCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
         $bin = $input->getArgument('bin');
         $workingDirectory = $input->getOption('working-directory');
 
         if (!$bin) {
-            $io->error(
+            $this->getIo()->error(
                 $this->trans('commands.exec.messages.missing-bin')
             );
 
@@ -86,7 +81,7 @@ class ExecCommand extends Command
 
         $finder = new ExecutableFinder();
         if (!$finder->find($name)) {
-            $io->error(
+            $this->getIo()->error(
                 sprintf(
                     $this->trans('commands.exec.messages.binary-not-found'),
                     $name
@@ -97,18 +92,18 @@ class ExecCommand extends Command
         }
 
         if (!$this->shellProcess->exec($bin, $workingDirectory)) {
-            $io->error(
+            $this->getIo()->error(
                 sprintf(
                     $this->trans('commands.exec.messages.invalid-bin')
                 )
             );
 
-            $io->writeln($this->shellProcess->getOutput());
+            $this->getIo()->writeln($this->shellProcess->getOutput());
 
             return 1;
         }
 
-        $io->success(
+        $this->getIo()->success(
             sprintf(
                 $this->trans('commands.exec.messages.success'),
                 $bin