NotAcceptableHttpException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
1
<?php
2
3
/*
4
 * http-exception (https://github.com/juliangut/http-exception).
5
 * HTTP aware exceptions.
6
 *
7
 * @license BSD-3-Clause
8
 * @link https://github.com/juliangut/http-exception
9
 * @author Julián Gutiérrez <[email protected]>
10
 */
11
12
declare(strict_types=1);
13
14
namespace Jgut\HttpException;
15
16
use Fig\Http\Message\StatusCodeInterface;
17
18
/**
19
 * HTTP 406 Not Acceptable exception class.
20
 */
21
class NotAcceptableHttpException extends HttpException
22
{
23
    /**
24
     * Not Acceptable Exception constructor.
25
     *
26
     * @param string|null     $message
27
     * @param string|null     $description
28
     * @param int|null        $code
29
     * @param \Throwable|null $previous
30
     */
31
    public function __construct(
32
        string $message = null,
33
        string $description = null,
34
        int $code = null,
35
        \Throwable $previous = null
36
    ) {
37
        parent::__construct(
38
            $message ?? 'Not Acceptable',
39
            $description ?? '',
40
            $code ?? StatusCodeInterface::STATUS_NOT_ACCEPTABLE,
41
            StatusCodeInterface::STATUS_NOT_ACCEPTABLE,
42
            $previous
43
        );
44
    }
45
}
46