function annotationcommand_adapter_command_names

master annotationcommand_adapter.inc annotationcommand_adapter_command_names($command)

Build all of the name variants for a Drush $command record

Parameters

array $command Drush command record:

Return value

string[]

3 calls to annotationcommand_adapter_command_names()
annotationcommand_adapter_add_hook_options in includes/annotationcommand_adapter.inc
Modify a $command record, adding option definitions defined by any command hook.
annotationcommand_adapter_process_command in includes/annotationcommand_adapter.inc
This function is set as the $command['callback'] for commands that have been converted to annotated commands. When the DRUSH_SYMFONY environment variable is set, these will be called via Symfony's Application::run() method. Otherwise,…
_drush_invoke_hooks in includes/command.inc
Invoke Drush API calls, including all hooks.

File

includes/annotationcommand_adapter.inc, line 498
annotationcommand_adapter.inc

Code

function annotationcommand_adapter_command_names($command) {
  $names = array_merge([$command['command']], $command['aliases']);
  if (!empty($command['annotated-command-callback'])) {
    $commandHandler = $command['annotated-command-callback'][0];
    $reflectionClass = new \ReflectionClass($commandHandler);
    $commandFileClass = $reflectionClass->getName();
    $names[] = $commandFileClass;
  }
  return $names;
}