You are here

class ConsoleTerminateEvent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Event/ConsoleTerminateEvent.php \Symfony\Component\Console\Event\ConsoleTerminateEvent

Allows to manipulate the exit code of a command after its execution.

@author Francesco Levorato <git@flevour.net>

Hierarchy

Expanded class hierarchy of ConsoleTerminateEvent

2 files declare their use of ConsoleTerminateEvent
Application.php in vendor/symfony/console/Application.php
ApplicationTest.php in vendor/symfony/console/Tests/ApplicationTest.php

File

vendor/symfony/console/Event/ConsoleTerminateEvent.php, line 23

Namespace

Symfony\Component\Console\Event
View source
class ConsoleTerminateEvent extends ConsoleEvent {

  /**
   * The exit code of the command.
   *
   * @var int
   */
  private $exitCode;
  public function __construct(Command $command, InputInterface $input, OutputInterface $output, $exitCode) {
    parent::__construct($command, $input, $output);
    $this
      ->setExitCode($exitCode);
  }

  /**
   * Sets the exit code.
   *
   * @param int $exitCode The command exit code
   */
  public function setExitCode($exitCode) {
    $this->exitCode = (int) $exitCode;
  }

  /**
   * Gets the exit code.
   *
   * @return int The command exit code
   */
  public function getExitCode() {
    return $this->exitCode;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConsoleEvent::$command protected property
ConsoleEvent::$input private property
ConsoleEvent::$output private property
ConsoleEvent::getCommand public function Gets the command that is executed.
ConsoleEvent::getInput public function Gets the input instance.
ConsoleEvent::getOutput public function Gets the output instance.
ConsoleTerminateEvent::$exitCode private property The exit code of the command.
ConsoleTerminateEvent::getExitCode public function Gets the exit code.
ConsoleTerminateEvent::setExitCode public function Sets the exit code.
ConsoleTerminateEvent::__construct public function Overrides ConsoleEvent::__construct
Event::$dispatcher private property
Event::$name private property
Event::$propagationStopped private property
Event::getDispatcher Deprecated public function Returns the EventDispatcher that dispatches this Event.
Event::getName Deprecated public function Gets the event's name.
Event::isPropagationStopped public function Returns whether further event listeners should be triggered.
Event::setDispatcher Deprecated public function Stores the EventDispatcher that dispatches this Event.
Event::setName Deprecated public function Sets the event's name property.
Event::stopPropagation public function Stops the propagation of the event to further event listeners.