/**
* @file
- * Contains \Drupal\Console\Command\Breakpoints\DebugCommand.
+ * Contains \Drupal\Console\Command\Debug\BreakpointsCommand.
*/
-namespace Drupal\Console\Command\Breakpoints;
+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\Command;
use Drupal\breakpoint\BreakpointManagerInterface;
use Symfony\Component\Yaml\Yaml;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
use Drupal\Console\Annotations\DrupalCommand;
-use Drupal\Console\Core\Style\DrupalStyle;
/**
* @DrupalCommand(
* extensionType = "module"
* )
*/
-class DebugCommand extends Command
+class BreakpointsCommand extends Command
{
- use CommandTrait;
-
/**
* @var BreakpointManagerInterface
*/
protected $appRoot;
/**
- * DebugCommand constructor.
+ * BreakpointsCommand constructor.
*
* @param BreakpointManagerInterface $breakpointManager
* @param string $appRoot
*/
public function __construct(
- BreakpointManagerInterface $breakpointManager,
+ BreakpointManagerInterface $breakpointManager = null,
$appRoot
) {
$this->breakpointManager = $breakpointManager;
protected function configure()
{
$this
- ->setName('breakpoints:debug')
- ->setDescription($this->trans('commands.breakpoints.debug.description'))
+ ->setName('debug:breakpoints')
+ ->setDescription($this->trans('commands.debug.breakpoints.description'))
->addArgument(
'group',
InputArgument::OPTIONAL,
- $this->trans('commands.breakpoints.debug.options.group-name')
- );
+ $this->trans('commands.debug.breakpoints.options.group-name')
+ )->setAliases(['dbre']);
}
/**
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
-
$group = $input->getArgument('group');
if ($group) {
$breakPointData = $this->getBreakpointByName($group);
foreach ($breakPointData as $key => $breakPoint) {
- $io->comment($key, false);
- $io->block(Yaml::dump($breakPoint));
+ $this->getIo()->comment($key, false);
+ $this->getIo()->block(Yaml::dump($breakPoint));
}
return 0;
$groups = array_keys($this->breakpointManager->getGroups());
$tableHeader = [
- $this->trans('commands.breakpoints.debug.messages.name'),
+ $this->trans('commands.debug.breakpoints.messages.name'),
];
- $io->table($tableHeader, $groups, 'compact');
+ $this->getIo()->table($tableHeader, $groups, 'compact');
return 0;
}