Total Complexity | 6 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class SixConnexResponse |
||
15 | { |
||
16 | protected Response $raw; |
||
17 | |||
18 | protected ?Collection $apicallsetoutput = null; |
||
19 | |||
20 | /** |
||
21 | * SixConnexResponse constructor. |
||
22 | * |
||
23 | * @param Response $rawResponse |
||
24 | */ |
||
25 | 4 | public function __construct(Response $rawResponse) |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @return Response |
||
32 | */ |
||
33 | 1 | public function getRawResponse(): Response |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return Collection |
||
40 | */ |
||
41 | 1 | public function outputCollection(): Collection |
|
42 | { |
||
43 | 1 | if (!$this->apicallsetoutput) { |
|
44 | 1 | $this->apicallsetoutput = $this->raw |
|
45 | 1 | ->collect('apicallsetoutput') |
|
46 | 1 | ->map(fn ($body) => new SixConnexOutput($body)); |
|
47 | } |
||
48 | |||
49 | 1 | return $this->apicallsetoutput; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return SixConnexOutput |
||
54 | */ |
||
55 | 1 | public function outputFirst(): SixConnexOutput |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * Dynamically proxy other methods to the underlying response. |
||
62 | * |
||
63 | * @param string $method |
||
64 | * @param array $parameters |
||
65 | * |
||
66 | * @return mixed |
||
67 | */ |
||
68 | 1 | public function __call($method, $parameters) |
|
71 | } |
||
72 | } |
||
73 |