Class PreHandleEvent
Dispatched before a command is handled.
Add a listener for this event to execute custom logic before or instead of
the default handler.
-
Symfony\Component\EventDispatcher\Event
-
Webmozart\Console\Api\Event\PreHandleEvent
Methods summary
public
|
|
public
Webmozart\Console\Api\Args\Args
|
#
getArgs( )
Returns the parsed console arguments.
Returns the parsed console arguments.
Returns
|
public
Webmozart\Console\Api\IO\IO
|
|
public
Webmozart\Console\Api\Command\Command
|
#
getCommand( )
Returns the executed command.
Returns the executed command.
Returns
|
public
boolean
|
#
isHandled( )
Returns whether the command was handled by the event listener.
Returns whether the command was handled by the event listener.
Returns
boolean Returns true if the command was handled and false
otherwise.
See
|
public
|
#
setHandled( boolean $handled )
Sets whether the command was handled by the event listener.
Sets whether the command was handled by the event listener.
If set to true , the handler configured for the command is not
executed. Instead the status code returned by Webmozart\Console\Api\Event\PreHandleEvent::getStatusCode()
is returned.
Parameters
- $handled
Whether the command was handled by the event
listener.
|
public
integer
|
#
getStatusCode( )
Returns the status code to return.
Returns the status code to return.
Returns
integer Returns 0 on success and any positive integer on error.
|
public
|
#
setStatusCode( integer $statusCode )
Sets the status code to return.
Sets the status code to return.
This method is only useful in combination with Webmozart\Console\Api\Event\PreHandleEvent::setHandled() .
If the event is not marked as handled, the status code is ignored.
Parameters
- $statusCode
Set to 0 on success and any positive integer on
error.
|