Passed
Pull Request — master (#2)
by Dominik
02:25
created

AbstractApiProblem::getTitle()   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 $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