function annotationcommand_adapter_call_initialize

master annotationcommand_adapter.inc annotationcommand_adapter_call_initialize($names, CommandData $commandData)

Convert from an old-style Drush initialize hook into annotated-command hooks.

Parameters

string[] $names All of the applicable names for the command being hooked:

CommandData $commandData All of the parameter data associated with the: current command invokation, including the InputInterface, OutputInterface and AnnotationData

See also

_drush_invoke_hooks().

1 call to annotationcommand_adapter_call_initialize()
_drush_invoke_hooks in includes/command.inc
Invoke Drush API calls, including all hooks.

File

includes/annotationcommand_adapter.inc, line 522
annotationcommand_adapter.inc

Code

function annotationcommand_adapter_call_initialize($names, CommandData $commandData) {
  $factory = \Drush::commandFactory();
  $hookManager = $factory->hookManager();

  $hooks = $hookManager->getHooks($names, [HookManager::PRE_INITIALIZE HookManager::INITIALIZE HookManager::POST_INITIALIZE], $commandData->annotationData());

  foreach ((array) $hooks as $hook) {
    if (!is_object($hook)) {
      $hook($commandData->input(), $commandData->annotationData());
    }
  }
}