PHP Класс Webmozart\Console\Api\Event\PreHandleEvent

Add a listener for this event to execute custom logic before or instead of the default handler.
С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Наследование: extends Symfony\Component\EventDispatcher\Event
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Args $args, IO $io, Command $command ) Creates the event.
getArgs ( ) : Args Returns the parsed console arguments.
getCommand ( ) : Command Returns the executed command.
getIO ( ) : IO Returns the I/O.
getStatusCode ( ) : integer Returns the status code to return.
isHandled ( ) : boolean Returns whether the command was handled by the event listener.
setHandled ( boolean $handled ) Sets whether the command was handled by the event listener.
setStatusCode ( integer $statusCode ) Sets the status code to return.

Описание методов

__construct() публичный Метод

Creates the event.
public __construct ( Args $args, IO $io, Command $command )
$args Webmozart\Console\Api\Args\Args The parsed console arguments.
$io Webmozart\Console\Api\IO\IO The I/O.
$command Webmozart\Console\Api\Command\Command The executed command.

getArgs() публичный Метод

Returns the parsed console arguments.
public getArgs ( ) : Args
Результат Webmozart\Console\Api\Args\Args The parsed console arguments.

getCommand() публичный Метод

Returns the executed command.
public getCommand ( ) : Command
Результат Webmozart\Console\Api\Command\Command The executed command.

getIO() публичный Метод

Returns the I/O.
public getIO ( ) : IO
Результат Webmozart\Console\Api\IO\IO The I/O.

getStatusCode() публичный Метод

Returns the status code to return.
public getStatusCode ( ) : integer
Результат integer Returns 0 on success and any positive integer on error.

isHandled() публичный Метод

Returns whether the command was handled by the event listener.
См. также: setHandled()
public isHandled ( ) : boolean
Результат boolean Returns `true` if the command was handled and `false` otherwise.

setHandled() публичный Метод

If set to true, the handler configured for the command is not executed. Instead the status code returned by {@link getStatusCode()} is returned.
public setHandled ( boolean $handled )
$handled boolean Whether the command was handled by the event listener.

setStatusCode() публичный Метод

This method is only useful in combination with {@link setHandled()}. If the event is not marked as handled, the status code is ignored.
public setStatusCode ( integer $statusCode )
$statusCode integer Set to 0 on success and any positive integer on error.