UnauthorizedException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
4
namespace ArcherZdip\LaravelApiAuth\Exceptions;
5
6
7
use Symfony\Component\HttpKernel\Exception\HttpException;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\HttpKe...Exception\HttpException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Component\HttpFoundation\Response as FoundationResponse;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\HttpFoundation\Response was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
/**
11
 * Class UnauthorizedException
12
 *
13
 * @package App\Exceptions
14
 */
15
class UnauthorizedException extends HttpException
16
{
17
    /**
18
     * @var int
19
     */
20
    protected $statusCode = FoundationResponse::HTTP_UNAUTHORIZED;
21
22
    /**
23
     * @var string
24
     */
25
    protected $message = 'Unauthorized';
26
27
28
    public function __construct(string $message = null, \Throwable $previous = null, array $headers = [], ?int $code = 0)
29
    {
30
        if (!$message) {
31
            $message = $this->message;
32
        }
33
34
        parent::__construct($this->statusCode, $message, $previous, $headers, $code);
35
    }
36
}