Method | Description | |
---|---|---|
__construct ( string $name = null, string $version = null ) | Creates a new console application. | |
addCommandConfig ( |
Adds a command configuration to the application. | |
addCommandConfigs ( array $configs ) : static | Adds command configurations to the application. | |
addEventListener ( string $eventName, callable $listener, integer $priority ) : static | Adds a listener for the given event name. | |
addEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static | Adds an event subscriber to the dispatcher. | |
addStyle ( |
Adds a style to the style set. | |
addStyles ( array $styles ) : static | Adds multiple styles to the style set. | |
beginCommand ( string $name ) : |
Starts a configuration block for a command. | |
create ( string $name = null, string $version = null ) : static | Creates a new console application. | |
editCommand ( string $name ) : |
Alias for {@link getCommandConfig()}. | |
getCommandConfig ( string $name ) : |
Returns the command configuration for a given name. | |
getCommandConfigs ( ) : |
Returns all registered command configurations. | |
getCommandResolver ( ) : Webmozart\Console\Api\Resolver\CommandResolver | Returns the used command resolver. | |
getDisplayName ( ) : string | Returns the application name as it is displayed in the help. | |
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface | Returns the event dispatcher used to dispatch the console events. | |
getHelp ( ) : string | Returns the help text of the application. | |
getIOFactory ( ) : callable | Returns the callable used to create {@link IO} instances. | |
getName ( ) : string | Returns the name of the application. | |
getStyleSet ( ) : |
Returns the configured style set. | |
getVersion ( ) : string | Returns the version of the application. | |
hasCommandConfig ( string $name ) : boolean | Returns whether the application has a command with a given name. | |
hasCommandConfigs ( ) : boolean | Returns whether the application has any registered command configurations. | |
isDebug ( ) : boolean | Returns whether the application is in debug mode. | |
isExceptionCaught ( ) : boolean | Returns whether the application catches and displays exceptions thrown while running a command. | |
isTerminatedAfterRun ( ) : boolean | Returns whether the PHP process is terminated after running a command. | |
removeEventListener ( string $eventName, callable $listener ) : static | Removes an event listener for the given event name. | |
removeEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static | Removes an event subscriber from the dispatcher. | |
removeStyle ( string $tag ) : static | Removes a style from the style set. | |
setCatchExceptions ( boolean $catch ) : static | Sets whether the application catches and displays exceptions thrown while running a command. | |
setCommandConfigs ( array $configs ) : static | Sets the command configurations of the application. | |
setCommandResolver ( Webmozart\Console\Api\Resolver\CommandResolver $commandResolver ) : static | Sets the used command resolver. | |
setDebug ( boolean $debug ) : static | Sets whether the application is in debug mode. | |
setDisplayName ( string $displayName ) : static | Sets the application name as it is displayed in the help. | |
setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null ) : static | Sets the event dispatcher for dispatching the console events. | |
setHelp ( string $help ) : static | Sets the help text of the application. | |
setIOFactory ( callable $ioFactory ) : static | Sets the callable used to create {@link IO} instances. | |
setName ( string $name ) : static | Sets the name of the application. | |
setStyleSet ( |
Sets the used style set. | |
setTerminateAfterRun ( boolean $terminate ) : static | Sets whether to terminate the PHP process after running a command. | |
setVersion ( string $version ) : static | Sets the version of the application. |
Method | Description | |
---|---|---|
getDefaultDisplayName ( ) : string | Returns the default display name used if no display name is set. |
public __construct ( string $name = null, string $version = null ) | ||
$name | string | The name of the application. |
$version | string | The application version. |
public addCommandConfig ( |
||
$config | The command configuration. | |
return | static | The current instance. |
public addCommandConfigs ( array $configs ) : static | ||
$configs | array | The command configurations. |
return | static | The current instance. |
public addEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static | ||
$subscriber | Symfony\Component\EventDispatcher\EventSubscriberInterface | The subscriber to add. |
return | static | The current instance. |
public addStyle ( |
||
$style | The style to add. | |
return | static | The current instance. |
public beginCommand ( string $name ) : |
||
$name | string | The name of the command. |
return | The command configuration. |
public editCommand ( string $name ) : |
||
$name | string | The name of the command to edit. |
return | The command configuration. |
public getCommandConfig ( string $name ) : |
||
$name | string | The name of the command. |
return | The command configuration. |
public getCommandConfigs ( ) : |
||
return | The command configurations. |
public getCommandResolver ( ) : Webmozart\Console\Api\Resolver\CommandResolver | ||
return | Webmozart\Console\Api\Resolver\CommandResolver | The command resolver. |
protected getDefaultDisplayName ( ) : string | ||
return | string | The default display name. |
public getDisplayName ( ) : string | ||
return | string | The display name. |
public getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface | ||
return | Symfony\Component\EventDispatcher\EventDispatcherInterface | The event dispatcher. |
public getIOFactory ( ) : callable | ||
return | callable | The callable or `null` if none was set. |
public getStyleSet ( ) : |
||
return | The style set. |
public getVersion ( ) : string | ||
return | string | The application version. |
public hasCommandConfig ( string $name ) : boolean | ||
$name | string | The name of the command. |
return | boolean | Returns `true` if the command configuration with the given name exists and `false` otherwise. |
public hasCommandConfigs ( ) : boolean | ||
return | boolean | Returns `true` if command configurations were added to the application and `false` otherwise. |
public isExceptionCaught ( ) : boolean | ||
return | boolean | Returns `true` if exceptions are caught and `false` otherwise. |
public isTerminatedAfterRun ( ) : boolean | ||
return | boolean | Returns `true` if the PHP process is terminated after {@link run()} and `false` otherwise. |
public removeEventListener ( string $eventName, callable $listener ) : static | ||
$eventName | string | The event name. |
$listener | callable | The callback to remove. |
return | static | The current instance. |
public removeEventSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber ) : static | ||
$subscriber | Symfony\Component\EventDispatcher\EventSubscriberInterface | The subscriber to remove. |
return | static | The current instance. |
public removeStyle ( string $tag ) : static | ||
$tag | string | The tag of the style to remove. |
return | static | The current instance. |
public setCatchExceptions ( boolean $catch ) : static | ||
$catch | boolean | Whether to catch and display exceptions thrown while running a command. |
return | static | The current instance. |
public setCommandConfigs ( array $configs ) : static | ||
$configs | array | The command configurations. |
return | static | The current instance. |
public setCommandResolver ( Webmozart\Console\Api\Resolver\CommandResolver $commandResolver ) : static | ||
$commandResolver | Webmozart\Console\Api\Resolver\CommandResolver | The command resolver. |
return | static | The current instance. |
public setDisplayName ( string $displayName ) : static | ||
$displayName | string | The display name. |
return | static | The current instance. |
public setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null ) : static | ||
$dispatcher | Symfony\Component\EventDispatcher\EventDispatcherInterface | The event dispatcher. |
return | static | The current instance. |
public setIOFactory ( callable $ioFactory ) : static | ||
$ioFactory | callable | The {@link IO} factory callable. |
return | static | The current instance. |
public setStyleSet ( |
||
$styleSet | The style set to use. | |
return | static | The current instance. |
public setTerminateAfterRun ( boolean $terminate ) : static | ||
$terminate | boolean | Whether to terminate the PHP process after running a command. |
return | static | The current instance. |
public setVersion ( string $version ) : static | ||
$version | string | The application version. |
return | static | The current instance. |