Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / src / Command / Site / MaintenanceCommand.php
index 3088e9c3995e77ff9ebe702947270cc96e8ffac6..c94368a5e5a3a5cc8966eb972872d68b3ac9488b 100644 (file)
@@ -10,17 +10,12 @@ namespace Drupal\Console\Command\Site;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait;
-use Drupal\Console\Core\Style\DrupalStyle;
+use Drupal\Console\Core\Command\ContainerAwareCommand;
 use Drupal\Core\State\StateInterface;
 use Drupal\Console\Core\Utils\ChainQueue;
 
-class MaintenanceCommand extends Command
+class MaintenanceCommand extends ContainerAwareCommand
 {
-    use ContainerAwareCommandTrait;
-
-
     /**
      * @var StateInterface
      */
@@ -55,14 +50,13 @@ class MaintenanceCommand extends Command
             ->addArgument(
                 'mode',
                 InputArgument::REQUIRED,
-                $this->trans('commands.site.maintenance.arguments.mode').'[on/off]'
-            );
+                $this->trans('commands.site.maintenance.arguments.mode')
+            )
+            ->setAliases(['sma']);
     }
 
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         $mode = $input->getArgument('mode');
         $stateName = 'system.maintenance_mode';
         $modeMessage = null;
@@ -82,7 +76,7 @@ class MaintenanceCommand extends Command
             $cacheRebuild = false;
         }
 
-        $io->info($this->trans($modeMessage));
+        $this->getIo()->info($this->trans($modeMessage));
 
         if ($cacheRebuild) {
             $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'all']);