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
*/
class DropCommand extends Command
{
- use CommandTrait;
use ConnectTrait;
/**
$this->trans('commands.database.drop.arguments.database'),
'default'
)
- ->setHelp($this->trans('commands.database.drop.help'));
+ ->setHelp($this->trans('commands.database.drop.help'))
+ ->setAliases(['dbd']);
}
/**
*/
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']
}
}
- $io->success(
+ $this->getIo()->success(
sprintf(
$this->trans('commands.database.drop.messages.table-drop'),
count($tableRows['success'])