| Total Complexity | 16 |
| Total Lines | 89 |
| Duplicated Lines | 0 % |
| Coverage | 95.24% |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | class Response implements ResponseInterface |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var array|null |
||
| 10 | */ |
||
| 11 | private $backtrace; |
||
| 12 | /** |
||
| 13 | * @var array|null |
||
| 14 | */ |
||
| 15 | private $data; |
||
| 16 | /** |
||
| 17 | * @var array|null |
||
| 18 | */ |
||
| 19 | private $note; |
||
| 20 | /** |
||
| 21 | * @var array|null |
||
| 22 | */ |
||
| 23 | private $profile; |
||
| 24 | /** |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | private $type; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param int|null $t |
||
| 31 | * @param array|null $r |
||
| 32 | * @param array|null $b |
||
| 33 | * @param array|null $p |
||
| 34 | * @param array|null $n |
||
| 35 | */ |
||
| 36 | 17 | public function __construct(int $t = null, array $r = null, array $b = null, array $p = null, array $n = null) |
|
| 37 | { |
||
| 38 | 17 | !$t ?: $this->type = $t; |
|
| 39 | 17 | !$r ?: $this->data = $r; |
|
| 40 | 17 | !$b ?: $this->backtrace = $b; |
|
| 41 | 17 | !$p ?: $this->profile = $p; |
|
| 42 | 17 | !$n ?: $this->note = $n; |
|
| 43 | 17 | } |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritdoc |
||
| 47 | */ |
||
| 48 | 17 | public function getType(): ?int |
|
| 49 | { |
||
| 50 | 17 | return $this->type; |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @inheritdoc |
||
| 55 | */ |
||
| 56 | 17 | public function getData() |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | 1 | public function isAtomic(): bool |
|
| 69 | { |
||
| 70 | 1 | return \is_string($this->data) || \count($this->data) === 1; |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @inheritdoc |
||
| 75 | */ |
||
| 76 | 1 | public function getBacktrace(): ?array |
|
| 77 | { |
||
| 78 | 1 | return $this->backtrace; |
|
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @inheritdoc |
||
| 83 | */ |
||
| 84 | 1 | public function getProfile(): ?array |
|
| 85 | { |
||
| 86 | 1 | return $this->profile; |
|
| 87 | } |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @inheritdoc |
||
| 91 | */ |
||
| 92 | 1 | public function getNote(): ?array |
|
| 95 | } |
||
| 96 | } |
||
| 97 |