class ConsoleExceptionEvent in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Event/ConsoleExceptionEvent.php \Symfony\Component\Console\Event\ConsoleExceptionEvent
Allows to handle exception thrown in a command.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\EventDispatcher\Event
- class \Symfony\Component\Console\Event\ConsoleEvent
- class \Symfony\Component\Console\Event\ConsoleExceptionEvent
- class \Symfony\Component\Console\Event\ConsoleEvent
Expanded class hierarchy of ConsoleExceptionEvent
2 files declare their use of ConsoleExceptionEvent
- Application.php in vendor/
symfony/ console/ Application.php - ApplicationTest.php in vendor/
symfony/ console/ Tests/ ApplicationTest.php
File
- vendor/
symfony/ console/ Event/ ConsoleExceptionEvent.php, line 23
Namespace
Symfony\Component\Console\EventView source
class ConsoleExceptionEvent extends ConsoleEvent {
private $exception;
private $exitCode;
public function __construct(Command $command, InputInterface $input, OutputInterface $output, \Exception $exception, $exitCode) {
parent::__construct($command, $input, $output);
$this
->setException($exception);
$this->exitCode = (int) $exitCode;
}
/**
* Returns the thrown exception.
*
* @return \Exception The thrown exception
*/
public function getException() {
return $this->exception;
}
/**
* Replaces the thrown exception.
*
* This exception will be thrown if no response is set in the event.
*
* @param \Exception $exception The thrown exception
*/
public function setException(\Exception $exception) {
$this->exception = $exception;
}
/**
* Gets the exit code.
*
* @return int The command exit code
*/
public function getExitCode() {
return $this->exitCode;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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. | |
ConsoleExceptionEvent:: |
private | property | ||
ConsoleExceptionEvent:: |
private | property | ||
ConsoleExceptionEvent:: |
public | function | Returns the thrown exception. | |
ConsoleExceptionEvent:: |
public | function | Gets the exit code. | |
ConsoleExceptionEvent:: |
public | function | Replaces the thrown exception. | |
ConsoleExceptionEvent:: |
public | function |
Overrides ConsoleEvent:: |
|
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. |