Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| HttpException | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getHeaders | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getStatusCode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Engelsystem\Http\Exceptions; |
| 6 | |
| 7 | use RuntimeException; |
| 8 | use Throwable; |
| 9 | |
| 10 | class HttpException extends RuntimeException |
| 11 | { |
| 12 | public function __construct( |
| 13 | protected int $statusCode, |
| 14 | string $message = '', |
| 15 | protected array $headers = [], |
| 16 | int $code = 0, |
| 17 | ?Throwable $previous = null |
| 18 | ) { |
| 19 | |
| 20 | parent::__construct($message, $code, $previous); |
| 21 | } |
| 22 | |
| 23 | public function getHeaders(): array |
| 24 | { |
| 25 | return $this->headers; |
| 26 | } |
| 27 | |
| 28 | public function getStatusCode(): int |
| 29 | { |
| 30 | return $this->statusCode; |
| 31 | } |
| 32 | } |