/**
* @file
- * Contains \Drupal\Console\Command\Views\PluginsDebugCommand.
+ * Contains \Drupal\Console\Command\Debug\ViewsPluginsCommand.
*/
-namespace Drupal\Console\Command\Views;
+namespace Drupal\Console\Command\Debug;
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\views\Views;
/**
- * Class PluginsDebugCommand
+ * Class ViewsPluginsCommand
*
- * @package Drupal\Console\Command\Views
+ * @package Drupal\Console\Command\Debug
*/
-class PluginsDebugCommand extends Command
+class ViewsPluginsCommand extends ContainerAwareCommand
{
- use ContainerAwareCommandTrait;
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
- ->setName('views:plugins:debug')
- ->setDescription($this->trans('commands.views.plugins.debug.description'))
+ ->setName('debug:views:plugins')
+ ->setDescription($this->trans('commands.debug.views.plugins.description'))
->addArgument(
'type',
InputArgument::OPTIONAL,
- $this->trans('commands.views.plugins.debug.arguments.type')
- );
+ $this->trans('commands.debug.views.plugins.arguments.type')
+ )->setAliases(['dvp']);
}
/**
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
$type = $input->getArgument('type');
- $this->pluginList($io, $type);
+ $this->pluginList($type);
}
/**
- * @param \Drupal\Console\Core\Style\DrupalStyle $io
* @param $type
*/
- protected function pluginList(DrupalStyle $io, $type)
+ protected function pluginList($type)
{
$plugins = Views::pluginList();
$tableHeader = [
- $this->trans('commands.views.plugins.debug.messages.type'),
- $this->trans('commands.views.plugins.debug.messages.name'),
- $this->trans('commands.views.plugins.debug.messages.provider'),
- $this->trans('commands.views.plugins.debug.messages.views'),
+ $this->trans('commands.debug.views.plugins.messages.type'),
+ $this->trans('commands.debug.views.plugins.messages.name'),
+ $this->trans('commands.debug.views.plugins.messages.provider'),
+ $this->trans('commands.debug.views.plugins.messages.views'),
];
- $io->table($tableHeader, $rows, 'compact');
+ $this->getIo()->table($tableHeader, $rows, 'compact');
}
}