Method | Description | |
---|---|---|
__construct ( string | null $name = null ) | Constructor. | |
addArgument ( string $name, integer $mode = null, string $description = '', mixed $default = null ) : |
Adds an argument. | |
addOption ( string $name, string $shortcut = null, integer $mode = null, string $description = '', mixed $default = null ) : |
Adds an option. | |
addUsage ( string $usage ) : |
Add a command usage example. | |
getAliases ( ) : array | Returns the aliases for the command. | |
getApplication ( ) : |
Gets the application instance for this command. | |
getDefinition ( ) : Symfony\Component\Console\Input\InputDefinition | Gets the InputDefinition attached to this Command. | |
getDescription ( ) : string | Returns the description for the command. | |
getHelp ( ) : string | Returns the help for the command. | |
getHelper ( string $name ) : mixed | Gets a helper instance by name. | |
getHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet | Gets the helper set. | |
getName ( ) : string | Returns the command name. | |
getNativeDefinition ( ) : Symfony\Component\Console\Input\InputDefinition | Gets the InputDefinition to be used to create representations of this Command. | |
getProcessedHelp ( ) : string | Returns the processed help for the command replacing the %command.name% and %command.full_name% patterns with the real values dynamically. | |
getSynopsis ( boolean $short = false ) : string | Returns the synopsis for the command. | |
getUsages ( ) : array | Returns alternative usages of the command. | |
ignoreValidationErrors ( ) | Ignores validation errors. | |
isEnabled ( ) : boolean | Checks whether the command is enabled or not in the current environment. | |
isHidden ( ) : boolean | ||
mergeApplicationDefinition ( boolean $mergeArgs = true ) | Merges the application definition with the command definition. | |
run ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | Runs the command. | |
setAliases ( string[] $aliases ) : |
Sets the aliases for the command. | |
setApplication ( |
Sets the application instance for this command. | |
setCode ( callable $code ) : |
Sets the code to execute when running this command. | |
setDefinition ( array | Symfony\Component\Console\Input\InputDefinition $definition ) : |
Sets an array of argument and option instances. | |
setDescription ( string $description ) : |
Sets the description for the command. | |
setHelp ( string $help ) : |
Sets the help for the command. | |
setHelperSet ( Symfony\Component\Console\Helper\HelperSet $helperSet ) | Sets the helper set. | |
setHidden ( boolean $hidden ) : |
||
setName ( string $name ) : |
Sets the name of the command. | |
setProcessTitle ( string $title ) : |
Sets the process title of the command. |
Method | Description | |
---|---|---|
configure ( ) | Configures the current command. | |
execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : null | integer | Executes the current command. | |
initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) | Initializes the command just after the input has been validated. | |
interact ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) | Interacts with the user. |
Method | Description | |
---|---|---|
validateName ( string $name ) | Validates a command name. |
public __construct ( string | null $name = null ) | ||
$name | string | null | The name of the command; passing null means it must be set in configure() |
public addArgument ( string $name, integer $mode = null, string $description = '', mixed $default = null ) : |
||
$name | string | The argument name |
$mode | integer | The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL |
$description | string | A description text |
$default | mixed | The default value (for InputArgument::OPTIONAL mode only) |
return | The current instance |
public addOption ( string $name, string $shortcut = null, integer $mode = null, string $description = '', mixed $default = null ) : |
||
$name | string | The option name |
$shortcut | string | The shortcut (can be null) |
$mode | integer | The option mode: One of the InputOption::VALUE_* constants |
$description | string | A description text |
$default | mixed | The default value (must be null for InputOption::VALUE_NONE) |
return | The current instance |
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : null | integer | ||
$input | Symfony\Component\Console\Input\InputInterface | An InputInterface instance |
$output | Symfony\Component\Console\Output\OutputInterface | An OutputInterface instance |
return | null | integer | null or 0 if everything went fine, or an error code |
public getAliases ( ) : array | ||
return | array | An array of aliases for the command |
public getApplication ( ) : |
||
return | An Application instance |
public getDefinition ( ) : Symfony\Component\Console\Input\InputDefinition | ||
return | Symfony\Component\Console\Input\InputDefinition | An InputDefinition instance |
public getDescription ( ) : string | ||
return | string | The description for the command |
public getHelperSet ( ) : Symfony\Component\Console\Helper\HelperSet | ||
return | Symfony\Component\Console\Helper\HelperSet | A HelperSet instance |
public getNativeDefinition ( ) : Symfony\Component\Console\Input\InputDefinition | ||
return | Symfony\Component\Console\Input\InputDefinition | An InputDefinition instance |
public getProcessedHelp ( ) : string | ||
return | string | The processed help for the command |
public getSynopsis ( boolean $short = false ) : string | ||
$short | boolean | Whether to show the short version of the synopsis (with options folded) or not |
return | string | The synopsis |
public ignoreValidationErrors ( ) |
protected initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) | ||
$input | Symfony\Component\Console\Input\InputInterface | An InputInterface instance |
$output | Symfony\Component\Console\Output\OutputInterface | An OutputInterface instance |
protected interact ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) | ||
$input | Symfony\Component\Console\Input\InputInterface | An InputInterface instance |
$output | Symfony\Component\Console\Output\OutputInterface | An OutputInterface instance |
public mergeApplicationDefinition ( boolean $mergeArgs = true ) | ||
$mergeArgs | boolean | Whether to merge or not the Application definition arguments to Command definition arguments |
public run ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | ||
$input | Symfony\Component\Console\Input\InputInterface | An InputInterface instance |
$output | Symfony\Component\Console\Output\OutputInterface | An OutputInterface instance |
return | integer | The command exit code |
public setAliases ( string[] $aliases ) : |
||
$aliases | string[] | An array of aliases for the command |
return | The current instance |
public setApplication ( |
||
$application | An Application instance |
public setDefinition ( array | Symfony\Component\Console\Input\InputDefinition $definition ) : |
||
$definition | array | Symfony\Component\Console\Input\InputDefinition | An array of argument and option instances or a definition instance |
return | The current instance |
public setDescription ( string $description ) : |
||
$description | string | The description for the command |
return | The current instance |
public setHelperSet ( Symfony\Component\Console\Helper\HelperSet $helperSet ) | ||
$helperSet | Symfony\Component\Console\Helper\HelperSet | A HelperSet instance |
public setProcessTitle ( string $title ) : |
||
$title | string | The process title |
return | The current instance |