| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 1 | public function index($page = 1, $limit = 500): array |
|
| 28 | { |
||
| 29 | 1 | $response = $this->client->get( |
|
| 30 | 1 | $this->buildPath($this->path) |
|
| 31 | 1 | . '/?page=' . $page |
|
| 32 | 1 | . '&limit=' . $limit |
|
| 33 | ); |
||
| 34 | |||
| 35 | 1 | $contents = $response->getBody()->getContents(); |
|
| 36 | |||
| 37 | 1 | $data = json_decode($contents, true); |
|
| 38 | |||
| 39 | 1 | $array = []; |
|
| 40 | 1 | foreach ($data['data'] as $object) { |
|
| 41 | 1 | $array[] = new Language($object); |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | return $array; |
|
| 45 | } |
||
| 76 | } |