GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 13-20 lines in 3 locations

src/Clients/LanguagesClient.php 2 locations

@@ 27-45 (lines=19) @@
24
     * @return array
25
     * @throws FailedToParseException
26
     */
27
    public function index($page = 1, $limit = 500): array
28
    {
29
        $response = $this->client->get(
30
            $this->buildPath($this->path)
31
            . '/?page=' . $page
32
            . '&limit=' . $limit
33
        );
34
35
        $contents = $response->getBody()->getContents();
36
37
        $data = json_decode($contents, true);
38
39
        $array = [];
40
        foreach ($data['data'] as $object) {
41
            $array[] = new Language($object);
42
        }
43
44
        return $array;
45
    }
46
47
    /**
48
     * search
@@ 56-75 (lines=20) @@
53
     * @return array
54
     * @throws FailedToParseException
55
     */
56
    public function search(String $term, $page = 1, $limit = 500): array
57
    {
58
        $response = $this->client->get($this->buildPath(
59
            $this->path
60
            . '/?search=' . $term
61
            . '&page=' . $page
62
            . '&limit=' . $limit
63
        ));
64
65
        $contents = $response->getBody()->getContents();
66
67
        $data = json_decode($contents, true);
68
69
        $array = [];
70
        foreach ($data['data'] as $object) {
71
            $array[] = new Language($object);
72
        }
73
74
        return $array;
75
    }
76
}

src/Clients/LocalizeLanguagesClient.php 1 location

@@ 26-38 (lines=13) @@
23
     * @return array
24
     * @throws FailedToParseException
25
     */
26
    public function index(string $platform): array
27
    {
28
        $response = $this->client->get($this->buildPath($this->path . '/' . $platform . '/languages'));
29
        $contents = $response->getBody()->getContents();
30
        $data = json_decode($contents, true);
31
32
        $array = [];
33
        foreach ($data['data'] as $object) {
34
            $array[] = new Language($object);
35
        }
36
37
        return $array;
38
    }
39
40
    /**
41
     * bestFit