Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
14 | 160 | public function __construct( |
|
15 | string $message = '', |
||
16 | Throwable $previous = null, |
||
17 | protected array $headers = [], |
||
18 | int $code = 0 |
||
19 | ) { |
||
20 | 160 | if ('' === $message) { |
|
21 | 80 | $statusCode = $this->getStatusCode(); |
|
22 | 80 | $entity = (new HttpStatus($statusCode))->get(); |
|
23 | 80 | $message = sprintf('%d %s', $entity->statusCode, $entity->name); |
|
24 | } |
||
25 | |||
26 | 160 | parent::__construct($message, $code, $previous); |
|
27 | } |
||
39 |