Total Complexity | 4 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
22 | class StatusFormat extends AbstractFormat |
||
23 | { |
||
24 | 6 | protected function getVarValue(Request $request, Response|null $response, ?\Throwable $exception): string |
|
25 | { |
||
26 | 6 | if (null !== $response) { |
|
27 | 3 | return (string) $response->getStatusCode(); |
|
28 | } |
||
29 | |||
30 | 3 | if ($exception instanceof \Throwable) { |
|
31 | 2 | return (string) $exception->getCode(); |
|
32 | } |
||
33 | |||
34 | 1 | return '500'; |
|
35 | } |
||
36 | |||
37 | 6 | protected function getVarName(): string |
|
40 | } |
||
41 | } |
||
42 |