Methods summary
public
|
#
__construct( )
Creates a new configuration.
Creates a new configuration.
|
public
Webmozart\Console\Api\Args\Format\Argument[]
|
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
#
addArgument( string $name, integer $flags = 0, string $description = null, mixed $default = null )
|
public
Webmozart\Console\Api\Args\Format\Option[]
|
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
#
addOption( string $longName, string $shortName = null, integer $flags = 0, string $description = null, mixed $default = null, string $valueName = '...' )
Adds an option.
Read Webmozart\Console\Api\Args\Format\Option for a more detailed description of console options.
Parameters
- $longName
- The long option name.
- $shortName
- The short option name. Can be
null .
- $flags
A bitwise combination of the flag constants in
the Webmozart\Console\Api\Args\Format\Option class.
- $description
- A one-line description of the option.
- $default
The default value. Must be null if the
flags contain Option::REQUIRED_VALUE.
- $valueName
The name of the value to be used in usage
examples of the option.
Returns
See
|
public
Symfony\Component\Console\Helper\HelperSet
|
#
getHelperSet( )
Returns the configured helper set.
Returns the configured helper set.
Returns
Symfony\Component\Console\Helper\HelperSet The helper set.
See
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
#
setHelperSet( Symfony\Component\Console\Helper\HelperSet $helperSet )
Sets the used helper set.
Sets the used helper set.
Parameters
- $helperSet
- The helper set.
Returns
See
|
public
Webmozart\Console\Api\Args\ArgsParser
|
#
getArgsParser( )
Returns the configured argument parser.
Returns the configured argument parser.
Returns
See
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
|
public
boolean
|
#
isLenientArgsParsingEnabled( )
Returns whether lenient argument parsing is enabled.
Returns whether lenient argument parsing is enabled.
When lenient argument parsing is enabled, the argument parser will not
fail if the console arguments contain invalid or missing arguments.
Returns
boolean Returns true if lenient parsing is enabled and false
otherwise.
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
#
enableLenientArgsParsing( )
Enables lenient argument parsing.
Enables lenient argument parsing.
When lenient argument parsing is enabled, the argument parser will not
fail if the console arguments contain invalid or missing arguments.
Lenient argument parsing is disabled by default.
Returns
See
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
#
disableLenientArgsParsing( )
Disables lenient argument parsing.
Disables lenient argument parsing.
When lenient argument parsing is enabled, the argument parser will not
fail if the console arguments contain invalid or missing arguments.
Lenient argument parsing is disabled by default.
Returns
See
|
public
object
|
#
getHandler( )
Returns the command handler to execute when a command is run.
Returns the command handler to execute when a command is run.
Returns
object The command handler.
See
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
#
setHandler( object|callable $handler )
Sets the command handler to execute when a command is run.
Sets the command handler to execute when a command is run.
You can pass:
* An object with handler methods. * A callable that receives a Command and returns an object with handler methods.
The name of the executed handler method can be configured with
Webmozart\Console\Api\Config\Config::setHandlerMethod() . By default, the method handle() is
executed.
Parameters
- $handler
The command handler or the callable
creating a new command handler on demand.
Returns
See
|
public
string
|
#
getHandlerMethod( )
Returns the method of the command handler that should be executed when
the configured command is run.
Returns the method of the command handler that should be executed when
the configured command is run.
Returns
string The method name.
See
|
public
Webmozart\Console\Api\Config\ApplicationConfig |Webmozart\Console\Api\Config\CommandConfig |Webmozart\Console\Api\Config\SubCommandConfig |Webmozart\Console\Api\Config\OptionCommandConfig
|
#
setHandlerMethod( string $handlerMethod )
Sets the method of the command handler that should be executed when the
configured command is run.
Sets the method of the command handler that should be executed when the
configured command is run.
The method receives three arguments:
* Args $args : The console arguments. * IO $io : The I/O. * Command $command : The executed command.
Parameters
- $handlerMethod
- The method name.
Returns
See
|
protected
Symfony\Component\Console\Helper\HelperSet
|
#
getDefaultHelperSet( )
Returns the helper set to use if none is set.
Returns the helper set to use if none is set.
Returns
Symfony\Component\Console\Helper\HelperSet The default helper set.
|
protected
object
|
#
getDefaultHandler( )
Returns the command handler to use if none is set.
Returns the command handler to use if none is set.
Returns
object The default command handler.
|
protected
string
|
#
getDefaultHandlerMethod( )
Returns the handler method to use if none is set.
Returns the handler method to use if none is set.
Returns
string The default handler method.
|
protected
Webmozart\Console\Api\Args\ArgsParser
|
#
getDefaultArgsParser( )
Returns the arguments parser to use if none is set.
Returns the arguments parser to use if none is set.
Returns
|
protected
boolean
|
#
getDefaultLenientArgsParsing( )
Returns whether the arguments parsing handles errors gracefully.
Returns whether the arguments parsing handles errors gracefully.
Returns
boolean The default value for lenient args parsing.
|
protected
|
#
configure( )
Adds the default configuration.
Adds the default configuration.
Override this method in your own subclasses.
|