extensionManager = $extensionManager; parent::__construct(); } protected function configure() { $this ->setName('module:path') ->setDescription($this->trans('commands.module.path.description')) ->addArgument( 'module', InputArgument::REQUIRED, $this->trans('commands.module.path.arguments.module') ) ->addOption( 'absolute', null, InputOption::VALUE_NONE, $this->trans('commands.module.path.options.absolute') ); } 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( $module->getPath($fullPath) ); } /** * {@inheritdoc} */ 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); $input->setArgument('module', $module); } } }