| Conditions | 1 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function get($location = "london") : Weather |
||
| 32 | { |
||
| 33 | $reponse = json_decode($this->client->get(self::ENDPOINT, ['q' => $location]), true); |
||
| 34 | |||
| 35 | $description = $reponse['weather'][0]['description']; |
||
| 36 | $temparature = $reponse['main']['temp']; |
||
| 37 | $location = $reponse['name']; |
||
| 38 | |||
| 39 | return new Weather($description, $temparature, $location); |
||
| 40 | } |
||
| 41 | } |