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

AbstractApiProblem::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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 $type;
13
14
    /**
15
     * @var int
16
     */
17
    private $status;
18
19
    /**
20
     * @var string
21
     */
22
    private $title;
23
24
    /**
25
     * @var string
26
     */
27
    private $detail;
28
29
    /**
30
     * @var string|null
31
     */
32
    private $instance;
33
34
    /**
35
     * @param string      $type
36
     * @param int         $status
37
     * @param string      $title
38
     * @param string|null $detail
39
     * @param string|null $instance
40
     */
41 2
    public function __construct(
42
        string $type,
43
        int $status,
44
        string $title,
45
        string $detail = null,
46
        string $instance = null
47
    ) {
48 2
        $this->type = $type;
49 2
        $this->status = $status;
50 2
        $this->title = $title;
51 2
        $this->detail = $detail;
52 2
        $this->instance = $instance;
53 2
    }
54
55
    /**
56
     * @return string
57
     */
58 2
    public function getType(): string
59
    {
60 2
        return $this->type;
61
    }
62
63
    /**
64
     * @return int
65
     */
66 2
    public function getStatus(): int
67
    {
68 2
        return $this->status;
69
    }
70
71
    /**
72
     * @return string
73
     */
74 2
    public function getTitle(): string
75
    {
76 2
        return $this->title;
77
    }
78
79
    /**
80
     * @return string|null
81
     */
82 2
    public function getDetail()
83
    {
84 2
        return $this->detail;
85
    }
86
87
    /**
88
     * @return string|null
89
     */
90 2
    public function getInstance()
91
    {
92 2
        return $this->instance;
93
    }
94
95
    /**
96
     * @return array
97
     */
98 2
    public function getHeaders(): array
99
    {
100 2
        return [];
101
    }
102
}
103