Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | class TagQuery extends Query |
||
18 | { |
||
19 | protected $exploreTagsMapper; |
||
20 | |||
21 | public function __construct($httpClient, ExploreTags $exploreTagsMapper = null) |
||
25 | } |
||
26 | |||
27 | public function findOne(string $tagName): Tag |
||
28 | { |
||
29 | $url = Endpoint::exploreTags($tagName); |
||
30 | $data = $this->fetchContentAsArray($url); |
||
31 | |||
32 | $data = $this->exploreTagsMapper->normalizeData(Tag::class, $data); |
||
33 | |||
34 | return $this->exploreTagsMapper->populate(Tag::class, $data); |
||
35 | } |
||
36 | |||
37 | public function findTopPosts(string $tagName) |
||
45 | } |
||
46 | } |
||
47 | } |