Debian Codegraph @

vendor/symfony/console/Event/ConsoleTerminateEvent.php

raw
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Console\Event;
13
14 use Symfony\Component\Console\Command\Command;
15 use Symfony\Component\Console\Input\InputInterface;
16 use 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 <[email protected]>
22 * @author Jules Pietri <[email protected]>
23 */
24 final 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 }