Total Complexity | 9 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class CaptureInteractiveResponse extends AbstractResponse |
||
7 | { |
||
8 | 2 | public function items(): array |
|
9 | { |
||
10 | 2 | $items = $this->json('Items', []); |
|
|
|||
11 | |||
12 | 2 | return is_array($items) ? $items : []; |
|
13 | } |
||
14 | |||
15 | 1 | public function failed(): bool |
|
16 | { |
||
17 | 1 | $items = $this->items(); |
|
18 | |||
19 | 1 | return (!count($items)) || !empty($items[0]['Error']); |
|
20 | } |
||
21 | |||
22 | 1 | public function success(): bool |
|
25 | } |
||
26 | |||
27 | 1 | public function errorCode(): string |
|
28 | { |
||
29 | 1 | return $this->items()[0]['Error'] ?? ''; |
|
30 | } |
||
31 | |||
32 | 1 | public function errorDescription(): string |
|
33 | { |
||
34 | 1 | return $this->items()[0]['Description'] ?? ''; |
|
35 | } |
||
36 | |||
37 | 1 | public function errorCause(): string |
|
40 | } |
||
41 | |||
42 | 1 | public function errorResolution(): string |
|
43 | { |
||
44 | 1 | return $this->items()[0]['Resolution'] ?? ''; |
|
47 |