Passed
Push — master ( 748bbc...6ff058 )
by Dominik
02:33
created

RequestUriTooLong   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 33
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getMaxUriLength() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiHttp\ApiProblem\ClientError;
6
7
use Chubbyphp\ApiHttp\ApiProblem\AbstractApiProblem;
8
9
final class RequestUriTooLong extends AbstractApiProblem
10
{
11
    /**
12
     * @var int
13
     */
14
    private $maxUriLength;
15
16
    /**
17
     * @param int         $maxUriLength
18
     * @param string|null $detail
19
     * @param string|null $instance
20
     */
21 2
    public function __construct(int $maxUriLength, string $detail = null, string $instance = null)
22
    {
23 2
        parent::__construct(
24 2
            'https://tools.ietf.org/html/rfc2616#section-10.4.15',
25 2
            414,
26 2
            'Request Uri Too Long',
27
            $detail,
28
            $instance
29
        );
30
31 2
        $this->maxUriLength = $maxUriLength;
32 2
    }
33
34
    /**
35
     * @return int
36
     */
37 2
    public function getMaxUriLength(): int
38
    {
39 2
        return $this->maxUriLength;
40
    }
41
}
42