class ConsoleCommandEvent in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Event/ConsoleCommandEvent.php \Symfony\Component\Console\Event\ConsoleCommandEvent
Allows to do things before the command is executed, like skipping the command or changing the input.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\EventDispatcher\Event
- class \Symfony\Component\Console\Event\ConsoleEvent
- class \Symfony\Component\Console\Event\ConsoleCommandEvent
- class \Symfony\Component\Console\Event\ConsoleEvent
Expanded class hierarchy of ConsoleCommandEvent
2 files declare their use of ConsoleCommandEvent
- Application.php in vendor/
symfony/ console/ Application.php - ApplicationTest.php in vendor/
symfony/ console/ Tests/ ApplicationTest.php
File
- vendor/
symfony/ console/ Event/ ConsoleCommandEvent.php, line 19
Namespace
Symfony\Component\Console\EventView source
class ConsoleCommandEvent extends ConsoleEvent {
/**
* The return code for skipped commands, this will also be passed into the terminate event.
*/
const RETURN_CODE_DISABLED = 113;
/**
* Indicates if the command should be run or skipped.
*
* @var bool
*/
private $commandShouldRun = true;
/**
* Disables the command, so it won't be run.
*
* @return bool
*/
public function disableCommand() {
return $this->commandShouldRun = false;
}
/**
* Enables the command.
*
* @return bool
*/
public function enableCommand() {
return $this->commandShouldRun = true;
}
/**
* Returns true if the command is runnable, false otherwise.
*
* @return bool
*/
public function commandShouldRun() {
return $this->commandShouldRun;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConsoleCommandEvent:: |
private | property | Indicates if the command should be run or skipped. | |
ConsoleCommandEvent:: |
public | function | Returns true if the command is runnable, false otherwise. | |
ConsoleCommandEvent:: |
public | function | Disables the command, so it won't be run. | |
ConsoleCommandEvent:: |
public | function | Enables the command. | |
ConsoleCommandEvent:: |
constant | The return code for skipped commands, this will also be passed into the terminate event. | ||
ConsoleEvent:: |
protected | property | ||
ConsoleEvent:: |
private | property | ||
ConsoleEvent:: |
private | property | ||
ConsoleEvent:: |
public | function | Gets the command that is executed. | |
ConsoleEvent:: |
public | function | Gets the input instance. | |
ConsoleEvent:: |
public | function | Gets the output instance. | |
ConsoleEvent:: |
public | function | 2 | |
Event:: |
private | property | ||
Event:: |
private | property | ||
Event:: |
private | property | ||
Event:: |
public | function | Returns the EventDispatcher that dispatches this Event. | |
Event:: |
public | function | Gets the event's name. | |
Event:: |
public | function | Returns whether further event listeners should be triggered. | |
Event:: |
public | function | Stores the EventDispatcher that dispatches this Event. | |
Event:: |
public | function | Sets the event's name property. | |
Event:: |
public | function | Stops the propagation of the event to further event listeners. |