4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Event;
14 use Symfony\Component\Console\Command\Command;
15 use Symfony\Component\Console\Input\InputInterface;
16 use Symfony\Component\Console\Output\OutputInterface;
19 * Allows to manipulate the exit code of a command after its execution.
21 * @author Francesco Levorato <git@flevour.net>
23 class ConsoleTerminateEvent extends ConsoleEvent
26 * The exit code of the command.
32 public function __construct(Command $command, InputInterface $input, OutputInterface $output, $exitCode)
34 parent::__construct($command, $input, $output);
36 $this->setExitCode($exitCode);
42 * @param int $exitCode The command exit code
44 public function setExitCode($exitCode)
46 $this->exitCode = (int) $exitCode;
52 * @return int The command exit code
54 public function getExitCode()
56 return $this->exitCode;