| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function index() |
||
| 12 | { |
||
| 13 | try { |
||
| 14 | $this->mustPassBasicAuthentication(); |
||
| 15 | } catch (Throwable $e) { |
||
| 16 | $this->httpResponse->response( |
||
| 17 | new JSONResponse( |
||
| 18 | ['message' => $e->getMessage()], |
||
| 19 | Response::HTTP_RESPONSE_UNAUTHORIZED, |
||
| 20 | Response::BASIC_AUTH_ACCESS_DENIED |
||
| 21 | ) |
||
| 22 | ); |
||
| 23 | exit; |
||
|
|
|||
| 24 | } |
||
| 27 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.