Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function __construct(\Exception $e) |
||
25 | { |
||
26 | $text = (new StatusCode)->statusText; |
||
27 | if ($e instanceof BadRequestException) { |
||
28 | $this->code = $e->getCode(); |
||
29 | $this->text = $text[$this->code]; |
||
30 | |||
31 | return; |
||
32 | } |
||
33 | if ($e instanceof \RuntimeException) { |
||
34 | $this->code = 503; |
||
35 | $this->text = $text[$this->code]; |
||
36 | |||
37 | return; |
||
38 | } |
||
39 | $this->code = 500; |
||
40 | $this->text = $text[$this->code]; |
||
41 | } |
||
42 | } |
||
43 |