class AnnotatedCommand extends Command implements HelpDocumentAlter (View source)

AnnotatedCommands are created automatically by the AnnotatedCommandFactory. Each command method in a command file will produce one AnnotatedCommand. These are then added to your Symfony Console Application object; nothing else is needed.

Optionally, though, you may extend AnnotatedCommand directly to make a single command. The usage pattern is the same as for any other Symfony Console command, except that you may omit the 'Confiure' method, and instead place your annotations on the execute() method.

Properties

protected $commandCallback
protected $completionCallback
protected $commandProcessor
protected $annotationData
protected $examples
protected $topics
protected $returnType
protected $injectedClasses
protected $parameterMap

Methods

__construct($name = null)

No description

setCommandCallback($commandCallback)

No description

setCompletionCallback($completionCallback)

No description

setCommandProcessor($commandProcessor)

No description

commandProcessor()

No description

getReturnType()

No description

setReturnType($returnType)

No description

getAnnotationData()

No description

setAnnotationData($annotationData)

No description

getTopics()

No description

setTopics($topics)

No description

setCommandInfo($commandInfo)

No description

getExampleUsages()

No description

addUsageOrExample($usage, $description)

No description

getCompletionCallback()

No description

helpAlter(DomDocument $originalDom)

No description

setCommandArguments($commandInfo)

No description

setCommandArgumentsFromParameters($commandInfo)

No description

getCommandArgumentMode($hasDefault, $defaultValue)

No description

setCommandOptions($commandInfo, $automaticOptions = [])

No description

addOptions($inputOptions, $automaticOptions = [])

No description

static 
inputOptionSetDescription($inputOption, $description) deprecated

No description

array
getNames()

Returns all of the hook names that may be called for this command.

optionsHook()

Add any options to this command that are defined by hook implementations

void
complete(CompletionInput $input, CompletionSuggestions $suggestions)

Route a completion request to the specified Callable if available.

optionsHookForHookAnnotations($commandInfoList)

No description

interact(InputInterface $input, OutputInterface $output)

{@inheritdoc}

initialize(InputInterface $input, OutputInterface $output)

No description

int
execute(InputInterface $input, OutputInterface $output)

{@inheritdoc}

processResults(InputInterface $input, OutputInterface $output, $results)

This function is available for use by a class that may wish to extend this class rather than use annotations to define commands. Using this technique does allow for the use of annotations to define hooks.

createCommandData(InputInterface $input, OutputInterface $output)

No description

injectIntoCommandfileInstance(InputInterface $input, OutputInterface $output)

Inject $input and $output into the command instance if it is set up to receive them.

Details

__construct($name = null)

No description

Parameters

$name

setCommandCallback($commandCallback)

No description

Parameters

$commandCallback

setCompletionCallback($completionCallback)

No description

Parameters

$completionCallback

setCommandProcessor($commandProcessor)

No description

Parameters

$commandProcessor

commandProcessor()

No description

getReturnType()

No description

setReturnType($returnType)

No description

Parameters

$returnType

getAnnotationData()

No description

setAnnotationData($annotationData)

No description

Parameters

$annotationData

getTopics()

No description

setTopics($topics)

No description

Parameters

$topics

setCommandInfo($commandInfo)

No description

Parameters

$commandInfo

getExampleUsages()

No description

addUsageOrExample($usage, $description)

No description

Parameters

$usage
$description

getCompletionCallback()

No description

helpAlter(DomDocument $originalDom)

No description

Parameters

DomDocument $originalDom

protected setCommandArguments($commandInfo)

No description

Parameters

$commandInfo

protected setCommandArgumentsFromParameters($commandInfo)

No description

Parameters

$commandInfo

protected getCommandArgumentMode($hasDefault, $defaultValue)

No description

Parameters

$hasDefault
$defaultValue

setCommandOptions($commandInfo, $automaticOptions = [])

No description

Parameters

$commandInfo
$automaticOptions

addOptions($inputOptions, $automaticOptions = [])

No description

Parameters

$inputOptions
$automaticOptions

static protected inputOptionSetDescription($inputOption, $description) deprecated

deprecated since 4.5.0

No description

Parameters

$inputOption
$description

array getNames()

Returns all of the hook names that may be called for this command.

Return Value

array

optionsHook()

Add any options to this command that are defined by hook implementations

void complete(CompletionInput $input, CompletionSuggestions $suggestions)

Route a completion request to the specified Callable if available.

Parameters

CompletionInput $input
CompletionSuggestions $suggestions

Return Value

void

optionsHookForHookAnnotations($commandInfoList)

No description

Parameters

$commandInfoList

protected interact(InputInterface $input, OutputInterface $output)

{@inheritdoc}

Parameters

InputInterface $input
OutputInterface $output

protected initialize(InputInterface $input, OutputInterface $output)

No description

Parameters

InputInterface $input
OutputInterface $output

protected int execute(InputInterface $input, OutputInterface $output)

{@inheritdoc}

Parameters

InputInterface $input
OutputInterface $output

Return Value

int

processResults(InputInterface $input, OutputInterface $output, $results)

This function is available for use by a class that may wish to extend this class rather than use annotations to define commands. Using this technique does allow for the use of annotations to define hooks.

Parameters

InputInterface $input
OutputInterface $output
$results

protected createCommandData(InputInterface $input, OutputInterface $output)

No description

Parameters

InputInterface $input
OutputInterface $output

State injectIntoCommandfileInstance(InputInterface $input, OutputInterface $output)

Inject $input and $output into the command instance if it is set up to receive them.

Parameters

InputInterface $input
OutputInterface $output

Return Value

State