| Conditions | 2 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 46 | 1 | public function get(): array |
|
| 47 | { |
||
| 48 | try { |
||
| 49 | 1 | $response = $this->client->get(self::RESOURCE); |
|
| 50 | 1 | $data = json_decode($response->getBody()->getContents(), true); |
|
| 51 | |||
| 52 | 1 | return array_map(function (array $season) { |
|
| 53 | 1 | return new Season($season); |
|
| 54 | 1 | }, $data); |
|
| 55 | 1 | } catch (GuzzleException $e) { |
|
| 56 | 1 | throw new Exception($e->getMessage()); |
|
| 57 | } |
||
| 60 |