Documentation

ConsoleCommandEvent extends ConsoleEvent
in package

Allows to do things before the command is executed, like skipping the command or executing code before the command is going to be executed.

Changing the input arguments will have no effect.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

RETURN_CODE_DISABLED  = 113
The return code for skipped commands, this will also be passed into the terminate event.
$command  : mixed
$commandShouldRun  : mixed
Indicates if the command should be run or skipped.
$input  : mixed
$output  : mixed
$propagationStopped  : mixed
__construct()  : mixed
commandShouldRun()  : bool
Returns true if the command is runnable, false otherwise.
disableCommand()  : bool
Disables the command, so it won't be run.
enableCommand()  : bool
getCommand()  : Command|null
Gets the command that is executed.
getInput()  : InputInterface
Gets the input instance.
getOutput()  : OutputInterface
Gets the output instance.
isPropagationStopped()  : bool
Is propagation stopped?
stopPropagation()  : void
Stops the propagation of the event to further event listeners.

Constants

RETURN_CODE_DISABLED

The return code for skipped commands, this will also be passed into the terminate event.

public mixed RETURN_CODE_DISABLED = 113

Properties

$commandShouldRun

Indicates if the command should be run or skipped.

private mixed $commandShouldRun = true

$propagationStopped

private mixed $propagationStopped = false

Methods

commandShouldRun()

Returns true if the command is runnable, false otherwise.

public commandShouldRun() : bool
Return values
bool

disableCommand()

Disables the command, so it won't be run.

public disableCommand() : bool
Return values
bool

isPropagationStopped()

Is propagation stopped?

public isPropagationStopped() : bool
Return values
bool

stopPropagation()

Stops the propagation of the event to further event listeners.

public stopPropagation() : void

If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation().

Return values
void

Search results