class Command (View source)

Represents a command

Properties

protected string $controllerClassName
protected string $controllerCommandName
protected string $commandIdentifier
protected MethodReflection $commandMethodReflection
protected ReflectionService $reflectionService
protected ObjectManagerInterface $objectManager

Methods

__construct(string $controllerClassName, string $controllerCommandName)

Constructor

injectReflectionService(ReflectionService $reflectionService)

No description

injectObjectManager(ObjectManagerInterface $objectManager)

No description

string
getControllerClassName()

No description

string
getControllerCommandName()

No description

string
getCommandIdentifier()

Returns the command identifier for this command

string
getShortDescription()

Returns a short description of this command

string
getDescription()

Returns a longer description of this command This is the complete method description except for the first line which can be retrieved via getShortDescription() If The command description only consists of one line, an empty string is returned

bool
hasArguments()

Returns true if this command expects required and/or optional arguments, otherwise false

array
getArgumentDefinitions()

Returns an array of CommandArgumentDefinition that contains information about required/optional arguments of this command.

bool
isInternal()

Tells if this command is internal and thus should not be exposed through help texts, user documentation etc.

bool
isDeprecated()

Tells if this command is deprecated and thus should be marked as such in help texts, user documentation etc.

bool
isFlushingCaches()

Tells if this command flushes all caches and thus needs special attention in the interactive shell.

array
getRelatedCommandIdentifiers()

Returns an array of command identifiers which were specified in the "@see" annotation of a command method.

Details

__construct(string $controllerClassName, string $controllerCommandName)

Constructor

Parameters

string $controllerClassName

Class name of the controller providing the command

string $controllerCommandName

Command name, i.e. the method name of the command, without the "Command" suffix

Exceptions

InvalidArgumentException

injectReflectionService(ReflectionService $reflectionService)

No description

Parameters

ReflectionService $reflectionService

Reflection service

injectObjectManager(ObjectManagerInterface $objectManager)

No description

Parameters

ObjectManagerInterface $objectManager

string getControllerClassName()

No description

Return Value

string

string getControllerCommandName()

No description

Return Value

string

string getCommandIdentifier()

Returns the command identifier for this command

Return Value

string

The command identifier for this command, following the pattern packagekey:controllername:commandname

string getShortDescription()

Returns a short description of this command

Return Value

string

A short description

string getDescription()

Returns a longer description of this command This is the complete method description except for the first line which can be retrieved via getShortDescription() If The command description only consists of one line, an empty string is returned

Return Value

string

A longer description of this command

bool hasArguments()

Returns true if this command expects required and/or optional arguments, otherwise false

Return Value

bool

array getArgumentDefinitions()

Returns an array of CommandArgumentDefinition that contains information about required/optional arguments of this command.

If the command does not expect any arguments, an empty array is returned

Return Value

array

bool isInternal()

Tells if this command is internal and thus should not be exposed through help texts, user documentation etc.

Internal commands are still accessible through the regular command line interface, but should not be used by users.

Return Value

bool

bool isDeprecated()

Tells if this command is deprecated and thus should be marked as such in help texts, user documentation etc.

Deprecated commands are still accessible through the regular command line interface, but should not be used by users anymore.

Return Value

bool

bool isFlushingCaches()

Tells if this command flushes all caches and thus needs special attention in the interactive shell.

Note that neither this method nor the @Flow\FlushesCaches annotation is currently part of the official API.

Return Value

bool

array getRelatedCommandIdentifiers()

Returns an array of command identifiers which were specified in the "@see" annotation of a command method.

Return Value

array

protected MethodReflection getCommandMethodReflection()

No description

Return Value

MethodReflection