function DevelCommands::hookInteract
Same name in other branches
- 5.x src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::hookInteract()
- 5.x src/Drush/Commands/DevelCommands.php \Drupal\devel\Drush\Commands\DevelCommands::hookInteract()
@hook interact hook
File
-
src/
Commands/ DevelCommands.php, line 133
Class
- DevelCommands
- Class DevelCommands.
Namespace
Drupal\devel\CommandsCode
public function hookInteract(Input $input, Output $output) {
if (!$input->getArgument('implementation')) {
if ($hook_implementations = $this->getModuleHandler()
->getImplementations($input->getArgument('hook'))) {
if (!($choice = $this->io()
->choice('Enter the number of the hook implementation you wish to view.', array_combine($hook_implementations, $hook_implementations)))) {
throw new UserAbortException();
}
$input->setArgument('implementation', $choice);
}
else {
throw new \Exception(dt('No implementations'));
}
}
}