Passed
Push — master ( 351b41...1b2537 )
by Marc
02:49
created

Response::__construct()   B

Complexity

Conditions 6
Paths 32

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 7
cts 7
cp 1
rs 8.8571
c 0
b 0
f 0
cc 6
eloc 6
nc 32
nop 5
crap 6
1
<?php
2
declare(strict_types=1);
3
4
namespace TBolier\RethinkQL\Response;
5
6
class Response implements ResponseInterface
7
{
8
    /**
9
     * @var int
10
     */
11
    private $type;
12
13
    /**
14
     * @var array|null
15
     */
16
    private $data;
17
18
    /**
19
     * @var array|null
20
     */
21
    private $backtrace;
22
23
    /**
24
     * @var array|null
25
     */
26
    private $profile;
27
28
    /**
29
     * @var array|null
30
     */
31
    private $note;
32
33
    /**
34
     * @param int|null $t
35
     * @param array|null $r
36
     * @param array|null $b
37
     * @param array|null $p
38
     * @param array|null $n
39
     */
40 16
    public function __construct(int $t = null, array $r = null, array $b = null, array $p = null, array $n = null)
41
    {
42 16
        !$t ?: $this->type = $t;
43 16
        !$r ?: $this->data = $r;
44 16
        !$b ?: $this->backtrace = $b;
45 16
        !$p ?: $this->profile = $p;
46 16
        !$n ?: $this->note = $n;
47 16
    }
48
49
    /**
50
     * @return int
51
     */
52 16
    public function getType(): ?int
53
    {
54 16
        return $this->type;
55
    }
56
57
    /**
58
     * @return array
59
     */
60 16
    public function getData(): ?array
61
    {
62 16
        return $this->data;
63
    }
64
65
    /**
66
     * @return array
67
     */
68 1
    public function getBacktrace(): ?array
69
    {
70 1
        return $this->backtrace;
71
    }
72
73
    /**
74
     * @return array
75
     */
76 1
    public function getProfile(): ?array
77
    {
78 1
        return $this->profile;
79
    }
80
81
    /**
82
     * @return array
83
     */
84 1
    public function getNote(): ?array
85
    {
86 1
        return $this->note;
87
    }
88
}
89