Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 1 | public function index(): array |
|
26 | { |
||
27 | 1 | $response = $this->client->get($this->buildPath($this->path)); |
|
28 | |||
29 | 1 | $contents = $response->getBody()->getContents(); |
|
30 | |||
31 | 1 | $data = json_decode($contents, true); |
|
32 | |||
33 | 1 | $array = []; |
|
34 | 1 | foreach ($data['data'] as $object) { |
|
35 | 1 | $array[] = new Continent($object); |
|
36 | } |
||
37 | |||
38 | 1 | return $array; |
|
39 | } |
||
59 | } |