summaryrefslogtreecommitdiff
path: root/vendor/symfony/console/Event/ConsoleTerminateEvent.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/console/Event/ConsoleTerminateEvent.php')
-rw-r--r--vendor/symfony/console/Event/ConsoleTerminateEvent.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/vendor/symfony/console/Event/ConsoleTerminateEvent.php
new file mode 100644
index 0000000..38f7253
--- /dev/null
+++ b/vendor/symfony/console/Event/ConsoleTerminateEvent.php
@@ -0,0 +1,50 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Console\Event;
13
14use Symfony\Component\Console\Command\Command;
15use Symfony\Component\Console\Input\InputInterface;
16use Symfony\Component\Console\Output\OutputInterface;
17
18/**
19 * Allows to manipulate the exit code of a command after its execution.
20 *
21 * @author Francesco Levorato <git@flevour.net>
22 * @author Jules Pietri <jules@heahprod.com>
23 */
24final class ConsoleTerminateEvent extends ConsoleEvent
25{
26 public function __construct(
27 Command $command,
28 InputInterface $input,
29 OutputInterface $output,
30 private int $exitCode,
31 private readonly ?int $interruptingSignal = null,
32 ) {
33 parent::__construct($command, $input, $output);
34 }
35
36 public function setExitCode(int $exitCode): void
37 {
38 $this->exitCode = $exitCode;
39 }
40
41 public function getExitCode(): int
42 {
43 return $this->exitCode;
44 }
45
46 public function getInterruptingSignal(): ?int
47 {
48 return $this->interruptingSignal;
49 }
50}