Passed
Pull Request — master (#6367)
by
unknown
09:09
created

NotAllowedException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getSeverity() 0 3 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
declare(strict_types=1);
6
7
namespace Chamilo\CoreBundle\Exception;
8
9
use Symfony\Component\HttpKernel\Exception\HttpException;
10
use Throwable;
11
12
class NotAllowedException extends HttpException
13
{
14
    private string $severity;
15
16
    public function __construct(
17
        string $message = 'Not allowed',
18
        string $severity = 'warning',
19
        int $statusCode = 403,
20
        array $headers = [],
21
        int $code = 0,
22
        Throwable $previous = null
23
    ) {
24
        $this->severity = $severity;
25
        parent::__construct($statusCode, $message, $previous, $headers, $code);
26
    }
27
28
    public function getSeverity(): string
29
    {
30
        return $this->severity;
31
    }
32
}
33