Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / src / Command / Module / PathCommand.php
index ff1500852d054a65208e6e627c56389545557c87..140d405897e2703c206ea97aa7f86a287b48d17a 100644 (file)
@@ -11,15 +11,12 @@ use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
+use Drupal\Console\Core\Command\Command;
 use Drupal\Console\Command\Shared\ModuleTrait;
-use Drupal\Console\Core\Style\DrupalStyle;
 use Drupal\Console\Extension\Manager;
 
 class PathCommand extends Command
 {
-    use CommandTrait;
     use ModuleTrait;
 
     /**
@@ -53,20 +50,18 @@ class PathCommand extends Command
                 null,
                 InputOption::VALUE_NONE,
                 $this->trans('commands.module.path.options.absolute')
-            );
+            )->setAliases(['mop']);
     }
 
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         $module = $input->getArgument('module');
 
         $fullPath = $input->getOption('absolute');
 
         $module = $this->extensionManager->getModule($module);
 
-        $io->info(
+        $this->getIo()->info(
             $module->getPath($fullPath)
         );
     }
@@ -76,13 +71,11 @@ class PathCommand extends Command
      */
     protected function interact(InputInterface $input, OutputInterface $output)
     {
-        $io = new DrupalStyle($input, $output);
-
         // --module argument
         $module = $input->getArgument('module');
         if (!$module) {
             // @see Drupal\Console\Command\Shared\ModuleTrait::moduleQuestion
-            $module = $this->moduleQuestion($io);
+            $module = $this->moduleQuestion();
             $input->setArgument('module', $module);
         }
     }