Doc   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
dl 0
loc 15
c 1
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 13 2
1
<?php
2
namespace Gvera\Controllers;
3
4
use Gvera\Helpers\dependencyInjection\DIContainer;
5
use Gvera\Helpers\http\JSONResponse;
6
use Gvera\Helpers\http\Response;
7
use Throwable;
8
9
class Doc extends GvController
10
{
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;
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
24
        }
25
    }
26
}
27