Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
18 | class LocationQuery extends Query |
||
19 | { |
||
20 | protected $exploreLocationsMapper; |
||
21 | |||
22 | public function __construct($httpClient, ExploreLocations $exploreLocationsMapper = null) |
||
26 | } |
||
27 | |||
28 | public function findOne(string $id): Location |
||
29 | { |
||
30 | $url = Endpoint::exploreLocations($id); |
||
31 | $data = $this->fetchContentAsArray($url); |
||
32 | |||
33 | $this->throwEmptyContentExceptionIfEmpty($data); |
||
34 | |||
35 | $data = $this->exploreLocationsMapper->normalizeData(Location::class, $data); |
||
36 | |||
37 | return $this->exploreLocationsMapper->populate(Location::class, $data); |
||
38 | } |
||
39 | |||
40 | public function findTopPosts(string $id) |
||
50 | } |
||
51 | } |
||
52 | } |