extensionManager->discoverModules() ->showInstalled() ->showUninstalled() ->showNoCore() ->getList(false); } if ($theme) { $themes = $this->extensionManager->discoverThemes() ->showInstalled() ->showUninstalled() ->showNoCore() ->getList(false); } if ($profile) { $profiles = $this->extensionManager->discoverProfiles() ->showInstalled() ->showUninstalled() ->showNoCore() ->showCore() ->getList(false); } $extensions = array_merge( $modules, $themes, $profiles ); if (empty($extensions)) { throw new \Exception('No extension available, execute the proper generator command to generate one.'); } $extension = $io->choiceNoList( $this->trans('commands.common.questions.extension'), array_keys($extensions) ); return $extensions[$extension]; } /** * @param DrupalStyle $io * * @return string * * @throws \Exception */ public function extensionTypeQuestion(DrupalStyle $io) { $extensionType = $io->choiceNoList( $this->trans('commands.common.questions.extension-type'), array_keys(['module', 'theme', 'profile']) ); return $extensionType; } }