Properties

$name

$name : 

Type

$kernel

$kernel : 

Type

$signature

$signature : 

Type

$description

$description : 

Type

$definition

$definition : 

Type

$ignoreValidationErrors

$ignoreValidationErrors : 

Type

$help

$help : 

Type

$code

$code : 

Type

$hidden

$hidden : 

Type

$aliases

$aliases : 

Type

Methods

__construct()

__construct(  $name = null) 

Command constructor.

Parameters

$name

isEnabled()

isEnabled() : boolean

Checks whether the command is enabled or not in the current environment.

Override this to check for x or y and return false if the command can not run properly under the current conditions.

Returns

boolean

getKernel()

getKernel() : mixed

Returns

mixed

setKernel()

setKernel(mixed  $kernel) 

Parameters

mixed $kernel

getProcessedHelp()

getProcessedHelp() : string

Returns the processed help for the command replacing the %command.name% and %command.full_name% patterns with the real values dynamically.

Returns

string —

The processed help for the command

setCode()

setCode(callable  $code) : $this

Sets the code to execute when running this command.

If this method is used, it ov

Parameters

callable $code

A callable

Throws

\ReflectionException

Returns

$this

getName()

getName() : string

Returns

string

setName()

setName(string  $name) : $this

Parameters

string $name

Returns

$this

getSignature()

getSignature() : string

Returns

string

setSignature()

setSignature(string  $signature) 

Parameters

string $signature

setHidden()

setHidden(boolean  $hidden) : \app\framework\Component\Console\Command\Command

Parameters

boolean $hidden

Whether or not the command should be hidden from the list of commands

Returns

\app\framework\Component\Console\Command\Command

The current instance

isHidden()

isHidden() : boolean

Returns

boolean —

whether the command should be publicly shown or not

getDescription()

getDescription() : string

Returns

string

setDescription()

setDescription(string  $description) : $this

Parameters

string $description

Returns

$this

getNativeDefinition()

getNativeDefinition() : \app\framework\Component\Console\Input\InputDefinition

Gets the InputDefinition to be used to create representations of this Command.

Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition.

This method is not part of public API and should not be used directly.

Returns

\app\framework\Component\Console\Input\InputDefinition

An InputDefinition instance

getHelp()

getHelp() : string

Returns

string

setHelp()

setHelp(string  $help) 

Parameters

string $help

setDefinition()

setDefinition(array|\app\framework\Component\Console\Input\InputDefinition  $definition) : $this

Sets an array of argument and option instances.

Parameters

array|\app\framework\Component\Console\Input\InputDefinition $definition

An array of argument and option instances or a definition instance

Returns

$this

getAliases()

getAliases() : array

Returns the aliases for the command.

Returns

array —

An array of aliases for the command

random_str()

random_str(integer  $length, string  $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') : string

Generate a random string, using a cryptographically secure pseudorandom number generator (random_int)

For PHP 7, random_int is a PHP core function For PHP 5.x, depends on https://github.com/paragonie/random_compat

Parameters

integer $length

How many characters do we want?

string $keyspace

A string of all possible characters to select from

Throws

\Exception

Returns

string

configure()

configure() 

Configures the current command.

interact()

interact(\app\framework\Component\Console\Input\InputInterface  $input) 

Interacts with the user.

This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments.

Parameters

\app\framework\Component\Console\Input\InputInterface $input

validateName()

validateName(string  $name) 

Validates a command name

It must be non-empty and parts can optionally be separated by ":".

Parameters

string $name

Throws

\InvalidArgumentException

When the name is invalid