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;
/**
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)
);
}
*/
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);
}
}