function annotationcommand_adapter_call_initialize

master annotationcommand_adapter_call_initialize($names, CommandData $commandData)

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


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


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


includes/, line 522


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());