Passed
Push — master ( d2acc8...748bbc )
by Dominik
02:45 queued 30s
created

AbstractApiProblem   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 61
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getHeaders() 0 4 1
A getTitle() 0 4 1
A getDetail() 0 4 1
A getInstance() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiHttp\ApiProblem;
6
7
abstract class AbstractApiProblem implements ApiProblemInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $title;
13
14
    /**
15
     * @var string
16
     */
17
    private $detail;
18
19
    /**
20
     * @var string|null
21
     */
22
    private $instance;
23
24
    /**
25
     * @param string      $title
26
     * @param string|null $detail
27
     * @param string|null $instance
28
     */
29 2
    public function __construct(string $title, string $detail = null, string $instance = null)
30
    {
31 2
        $this->title = $title;
32 2
        $this->detail = $detail;
33 2
        $this->instance = $instance;
34 2
    }
35
36
    /**
37
     * @return array
38
     */
39 2
    public function getHeaders(): array
40
    {
41 2
        return [];
42
    }
43
44
    /**
45
     * @return string
46
     */
47 2
    public function getTitle(): string
48
    {
49 2
        return $this->title;
50
    }
51
52
    /**
53
     * @return string|null
54
     */
55 2
    public function getDetail()
56
    {
57 2
        return $this->detail;
58
    }
59
60
    /**
61
     * @return string|null
62
     */
63 2
    public function getInstance()
64
    {
65 2
        return $this->instance;
66
    }
67
}
68