Code Duplication    Length = 7-7 lines in 4 locations

src/KvkClient.php 4 locations

@@ 32-38 (lines=7) @@
29
        $this->profileResponseFactory = $profileResponseFactory;
30
    }
31
32
    public function getProfile(QueryInterface $profileQuery): KvkPaginatorInterface
33
    {
34
        $json = $this->httpClient->getJson($this->httpClient->getEndpoint(MapperInterface::PROFILE, $profileQuery));
35
        $data = $this->decodeJsonToArray($json);
36
37
        return $this->profileResponseFactory->fromProfileData($data);
38
    }
39
40
    /**
41
     * Execute search query
@@ 44-50 (lines=7) @@
41
     * Execute search query
42
     * @author Patrick Development <[email protected]>
43
     */
44
    public function fetchSearch(QueryInterface $profileQuery): KvkPaginatorInterface
45
    {
46
        $json = $this->httpClient->getJson($this->httpClient->getEndpoint(MapperInterface::SEARCH, $profileQuery));
47
        $data = $this->decodeJsonToArray($json);
48
49
        return $this->profileResponseFactory->fromProfileData($data);
50
    }
51
52
    public function getNextPage(KvkPaginatorInterface $kvkPaginator): KvkPaginatorInterface
53
    {
@@ 52-58 (lines=7) @@
49
        return $this->profileResponseFactory->fromProfileData($data);
50
    }
51
52
    public function getNextPage(KvkPaginatorInterface $kvkPaginator): KvkPaginatorInterface
53
    {
54
        $json = $this->httpClient->getJson($this->httpClient->getUrl($kvkPaginator->getNextUrl()));
55
        $data = $this->decodeJsonToArray($json);
56
57
        return $this->profileResponseFactory->fromProfileData($data);
58
    }
59
60
    public function getPreviousPage(KvkPaginatorInterface $kvkPaginator): KvkPaginatorInterface
61
    {
@@ 60-66 (lines=7) @@
57
        return $this->profileResponseFactory->fromProfileData($data);
58
    }
59
60
    public function getPreviousPage(KvkPaginatorInterface $kvkPaginator): KvkPaginatorInterface
61
    {
62
        $json = $this->httpClient->getJson($this->httpClient->getUrl($kvkPaginator->getPreviousUrl()));
63
        $data = $this->decodeJsonToArray($json);
64
65
        return $this->profileResponseFactory->fromProfileData($data);
66
    }
67
68
    private function decodeJsonToArray(string $json): array
69
    {