Methods summary
public
|
#
__construct( string $name = null )
Constructor.
Parameters
- $name
string $name The name of the command
Throws
Api
|
public
|
#
ignoreValidationErrors( )
Ignores validation errors.
Ignores validation errors.
This is mainly useful for the help command.
|
public
|
|
public
|
|
public
Symfony\Component\Console\Helper\HelperSet
|
|
public
Symfony\Component\Console\Application
|
#
getApplication( )
Gets the application instance for this command.
Gets the application instance for this command.
Returns
Api
|
public
Boolean
|
#
isEnabled( )
Checks whether the command is enabled or not in the current environment
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
|
protected
|
#
configure( )
Configures the current command.
Configures the current command.
|
protected
null|integer
|
|
protected
|
|
protected
|
|
public
integer
|
|
public
Symfony\Component\Console\Command\Command
|
#
setCode( callable $code )
Sets the code to execute when running this command.
Sets the code to execute when running this command.
If this method is used, it overrides the code defined in the execute()
method.
Parameters
- $code
callable $code A callable(InputInterface $input, OutputInterface $output)
Returns
Throws
See
Api
|
public
Symfony\Component\Console\Command\Command
|
|
public
Symfony\Component\Console\Input\InputDefinition
|
#
getDefinition( )
Gets the InputDefinition attached to this Command.
Gets the InputDefinition attached to this Command.
Returns
Api
|
protected
Symfony\Component\Console\Input\InputDefinition
|
#
getNativeDefinition( )
Gets the InputDefinition to be used to create XML and Text representations of
this Command.
Gets the InputDefinition to be used to create XML and Text 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.
Returns
|
public
Symfony\Component\Console\Command\Command
|
#
addArgument( string $name, integer $mode = null, string $description = '', mixed $default = null )
Adds an argument.
Parameters
- $name
string $name The argument name
- $mode
integer $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
- $description
string $description A description text
- $default
mixed $default The default value (for InputArgument::OPTIONAL mode only)
Returns
Api
|
public
Symfony\Component\Console\Command\Command
|
#
addOption( string $name, string $shortcut = null, integer $mode = null, string $description = '', mixed $default = null )
Adds an option.
Parameters
- $name
string $name The option name
- $shortcut
string $shortcut The shortcut (can be null)
- $mode
integer $mode The option mode: One of the InputOption::VALUE_* constants
- $description
string $description A description text
- $default
mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or
InputOption::VALUE_NONE)
Returns
Api
|
public
Symfony\Component\Console\Command\Command
|
#
setName( string $name )
Sets the name of the command.
Sets the name of the command.
This method can set both the namespace and the name if you separate them by a
colon (:)
$command->setName('foo:bar');
Parameters
- $name
string $name The command name
Returns
Throws
Api
|
public
string
|
#
getName( )
Returns the command name.
Returns the command name.
Returns
string The command name
Api
|
public
Symfony\Component\Console\Command\Command
|
#
setDescription( string $description )
Sets the description for the command.
Sets the description for the command.
Parameters
- $description
string $description The description for the command
Returns
Api
|
public
string
|
#
getDescription( )
Returns the description for the command.
Returns the description for the command.
Returns
string The description for the command
Api
|
public
Symfony\Component\Console\Command\Command
|
#
setHelp( string $help )
Sets the help for the command.
Sets the help for the command.
Parameters
- $help
string $help The help for the command
Returns
Api
|
public
string
|
#
getHelp( )
Returns the help for the command.
Returns the help for the command.
Returns
string The help for the command
Api
|
public
string
|
#
getProcessedHelp( )
Returns the processed help for the command replacing the %command.name% and
%command.full_name% patterns with the real values dynamically.
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
|
public
Symfony\Component\Console\Command\Command
|
#
setAliases( array $aliases )
Sets the aliases for the command.
Sets the aliases for the command.
Parameters
- $aliases
array $aliases An array of aliases for the command
Returns
Api
|
public
array
|
#
getAliases( )
Returns the aliases for the command.
Returns the aliases for the command.
Returns
array An array of aliases for the command
Api
|
public
string
|
#
getSynopsis( )
Returns the synopsis for the command.
Returns the synopsis for the command.
Returns
string The synopsis
|
public
mixed
|
#
getHelper( string $name )
Gets a helper instance by name.
Gets a helper instance by name.
Parameters
- $name
string $name The helper name
Returns
mixed The helper value
Throws
Api
|
public
string
|
#
asText( )
Returns a text representation of the command.
Returns a text representation of the command.
Returns
string A string representing the command
|
public
string|DOMDocument
|
#
asXml( Boolean $asDom = false )
Returns an XML representation of the command.
Returns an XML representation of the command.
Parameters
- $asDom
Boolean $asDom Whether to return a DOM or an XML string
Returns
string|DOMDocument An XML string representing the command
|