Total Complexity | 4 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | final class ConsoleException extends Exception implements ConsoleExceptionContract |
||
23 | { |
||
24 | /** |
||
25 | * The exit code. |
||
26 | * |
||
27 | * @var int |
||
28 | */ |
||
29 | private $exitCode; |
||
30 | |||
31 | /** |
||
32 | * The headers. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | private $headers; |
||
37 | |||
38 | /** |
||
39 | * ConsoleException constructor. |
||
40 | */ |
||
41 | 3 | public function __construct( |
|
42 | int $exitCode, |
||
43 | string $message = null, |
||
44 | array $headers = [], |
||
45 | \Exception $previous = null, |
||
46 | ?int $code = 0 |
||
47 | ) { |
||
48 | 3 | $this->exitCode = $exitCode; |
|
49 | 3 | $this->headers = $headers; |
|
50 | |||
51 | 3 | parent::__construct($message, $code, $previous); |
|
52 | 3 | } |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 2 | public function getExitCode(): int |
|
58 | { |
||
59 | 2 | return $this->exitCode; |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 2 | public function getHeaders(): array |
|
66 | { |
||
67 | 2 | return $this->headers; |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 1 | public function setHeaders(array $headers): ConsoleExceptionContract |
|
78 | } |
||
79 | } |
||
80 |