Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / src / Command / Debug / BreakpointsCommand.php
similarity index 71%
rename from vendor/drupal/console/src/Command/Breakpoints/DebugCommand.php
rename to vendor/drupal/console/src/Command/Debug/BreakpointsCommand.php
index bbdbe86bd2490a005168c7aba3ae12f89e4c8404..d266fa74e19b65c0e7d9c97b349cffee28b7c6ca 100644 (file)
@@ -2,20 +2,18 @@
 
 /**
  * @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(
@@ -23,10 +21,8 @@ use Drupal\Console\Core\Style\DrupalStyle;
  *     extensionType = "module"
  * )
  */
-class DebugCommand extends Command
+class BreakpointsCommand extends Command
 {
-    use CommandTrait;
-
     /**
      * @var BreakpointManagerInterface
      */
@@ -38,13 +34,13 @@ class DebugCommand extends Command
     protected $appRoot;
 
     /**
-     * DebugCommand constructor.
+     * BreakpointsCommand constructor.
      *
      * @param BreakpointManagerInterface $breakpointManager
      * @param string                     $appRoot
      */
     public function __construct(
-        BreakpointManagerInterface $breakpointManager,
+        BreakpointManagerInterface $breakpointManager = null,
         $appRoot
     ) {
         $this->breakpointManager = $breakpointManager;
@@ -58,13 +54,13 @@ class DebugCommand extends Command
     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']);
     }
 
     /**
@@ -72,14 +68,12 @@ class DebugCommand extends Command
      */
     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;
@@ -87,10 +81,10 @@ class DebugCommand extends Command
         $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;
     }