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
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__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.