You are here

function drush_devel_fn_hook in Devel 8.2

Same name and namespace in other branches
  1. 8.3 drush/devel.drush8.inc \drush_devel_fn_hook()
  2. 8 drush/devel.drush8.inc \drush_devel_fn_hook()
  3. 6 devel.drush.inc \drush_devel_fn_hook()
  4. 7 devel.drush.inc \drush_devel_fn_hook()

Command handler. Show hook implementations.

File

drush/devel.drush8.inc, line 126
This file is only used by Drush8.

Code

function drush_devel_fn_hook($hook) {

  // Get implementations in the .install files as well.
  include_once './core/includes/install.inc';
  drupal_load_updates();
  if ($hook_implementations = \Drupal::moduleHandler()
    ->getImplementations($hook)) {
    if ($choice = drush_choice(array_combine($hook_implementations, $hook_implementations), 'Enter the number of the hook implementation you wish to view.')) {
      return drush_devel_fn_view($choice . "_{$hook}");
    }
  }
  else {
    drush_log(dt('No implementations.'), 'ok');
  }
}