Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / src / Command / Database / DropCommand.php
index 651f5fda4c87c4de50540d1cbf264bffc6d5c00c..0a079c00de4fe533486f560fc126ff3cb77d92d2 100644 (file)
@@ -10,11 +10,9 @@ namespace Drupal\Console\Command\Database;
 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\Command;
 use Drupal\Core\Database\Connection;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
 use Drupal\Console\Command\Shared\ConnectTrait;
-use Drupal\Console\Core\Style\DrupalStyle;
 
 /**
  * Class DropCommand
@@ -23,7 +21,6 @@ use Drupal\Console\Core\Style\DrupalStyle;
  */
 class DropCommand extends Command
 {
-    use CommandTrait;
     use ConnectTrait;
 
     /**
@@ -56,7 +53,8 @@ class DropCommand extends Command
                 $this->trans('commands.database.drop.arguments.database'),
                 'default'
             )
-            ->setHelp($this->trans('commands.database.drop.help'));
+            ->setHelp($this->trans('commands.database.drop.help'))
+            ->setAliases(['dbd']);
     }
 
     /**
@@ -64,14 +62,13 @@ class DropCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
         $database = $input->getArgument('database');
         $yes = $input->getOption('yes');
 
-        $databaseConnection = $this->resolveConnection($io, $database);
+        $databaseConnection = $this->resolveConnection($database);
 
         if (!$yes) {
-            if (!$io->confirm(
+            if (!$this->getIo()->confirm(
                 sprintf(
                     $this->trans('commands.database.drop.question.drop-tables'),
                     $databaseConnection['database']
@@ -95,7 +92,7 @@ class DropCommand extends Command
             }
         }
 
-        $io->success(
+        $this->getIo()->success(
             sprintf(
                 $this->trans('commands.database.drop.messages.table-drop'),
                 count($tableRows['success'])