Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / src / Command / Theme / DownloadCommand.php
index c12bd52e4de922403db092da053756075ccbfa81..9e77211e99492473f54c283256741952c6720b62 100644 (file)
@@ -11,9 +11,7 @@ use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
-use Drupal\Console\Core\Style\DrupalStyle;
+use Drupal\Console\Core\Command\Command;
 use Drupal\Console\Command\Shared\ProjectDownloadTrait;
 use Drupal\Console\Utils\DrupalApi;
 use GuzzleHttp\Client;
@@ -21,8 +19,6 @@ use GuzzleHttp\Client;
 class DownloadCommand extends Command
 {
     use ProjectDownloadTrait;
-    use CommandTrait;
-
 
     /**
      * @var DrupalApi
@@ -67,14 +63,22 @@ class DownloadCommand extends Command
         $this
             ->setName('theme:download')
             ->setDescription($this->trans('commands.theme.download.description'))
-            ->addArgument('theme', InputArgument::REQUIRED, $this->trans('commands.theme.download.arguments.theme'))
-            ->addArgument('version', InputArgument::OPTIONAL, $this->trans('commands.theme.download.arguments.version'))
+            ->addArgument(
+                'theme',
+                InputArgument::REQUIRED,
+                $this->trans('commands.theme.download.arguments.theme')
+            )
+            ->addArgument(
+                'version',
+                InputArgument::OPTIONAL,
+                $this->trans('commands.theme.download.arguments.version')
+            )
             ->addOption(
                 'composer',
                 null,
                 InputOption::VALUE_NONE,
                 $this->trans('commands.theme.download.options.composer')
-            );
+            )->setAliases(['thd']);
     }
 
     /**
@@ -82,8 +86,6 @@ class DownloadCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         $theme = $input->getArgument('theme');
         $version = $input->getArgument('version');
         $composer = $input->getOption('composer');
@@ -102,7 +104,7 @@ class DownloadCommand extends Command
                 true
             );
         } else {
-            $this->downloadProject($io, $theme, $version, 'theme');
+            $this->downloadProject($theme, $version, 'theme');
         }
     }
 
@@ -111,14 +113,12 @@ class DownloadCommand extends Command
      */
     protected function interact(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         $theme = $input->getArgument('theme');
         $version = $input->getArgument('version');
         $composer = $input->getOption('composer');
 
         if (!$version && !$composer) {
-            $version = $this->releasesQuestion($io, $theme);
+            $version = $this->releasesQuestion($theme);
             $input->setArgument('version', $version);
         }
     }