| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 11 | public function fetchWeather(string $coordinateString, string $option) : array |
|
| 42 | { |
||
| 43 | 11 | $coordinates = $this->parseCoordinates($coordinateString); |
|
| 44 | |||
| 45 | 5 | if ($option == "history") { |
|
| 46 | 2 | $weatherJSON = $this->service->history($coordinates, 30); |
|
| 47 | 2 | return $weatherJSON; |
|
| 48 | } else { |
||
| 49 | 3 | $weatherJSON = $this->service->forecast($coordinates); |
|
| 50 | 3 | return $weatherJSON[0]; |
|
| 51 | } |
||
| 54 |