Conditions | 2 |
Paths | 5 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
50 | 6 | public function getWeekWithLocation(CalendarWeek $calendarWeek, string $location): Week |
|
51 | { |
||
52 | 6 | $url = $this->urlBuilder->getUrlForLocationYearWeek($location, $calendarWeek); |
|
53 | try { |
||
54 | 6 | $response = $this->httpClient->get($url); |
|
55 | 3 | $jsonResponse = (string)$response->getBody(); |
|
56 | 3 | $jsonObject = json_decode($jsonResponse); |
|
57 | |||
58 | 3 | return Week::fromJson($jsonObject); |
|
59 | 3 | } catch (RequestException $requestException) { |
|
60 | 3 | throw new NetworkingException(); |
|
61 | } |
||
62 | } |
||
63 | |||
64 | } |