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 = 30-30 lines in 5 locations

tests/Api/CertificatesModuleTest.php 1 location

@@ 111-140 (lines=30) @@
108
        );
109
    }
110
111
    private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = [])
112
    {
113
        $response = $this->service->run(
114
            new Request(
115
                [
116
                    'SERVER_PORT' => 80,
117
                    'SERVER_NAME' => 'vpn.example',
118
                    'REQUEST_METHOD' => $requestMethod,
119
                    'PATH_INFO' => sprintf('/%s', $pathInfo),
120
                    'REQUEST_URI' => sprintf('/%s', $pathInfo),
121
                    'PHP_AUTH_USER' => $basicAuth[0],
122
                    'PHP_AUTH_PW' => $basicAuth[1],
123
                ],
124
                $getData,
125
                $postData
126
            )
127
        );
128
129
        $responseArray = json_decode($response->getBody(), true)[$pathInfo];
130
        if ($responseArray['ok']) {
131
            if (array_key_exists('data', $responseArray)) {
132
                return $responseArray['data'];
133
            }
134
135
            return true;
136
        }
137
138
        // in case of errors...
139
        return $responseArray;
140
    }
141
}
142

tests/Api/OpenVpnModuleTest.php 1 location

@@ 120-149 (lines=30) @@
117
        );
118
    }
119
120
    private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = [])
121
    {
122
        $response = $this->service->run(
123
            new Request(
124
                [
125
                    'SERVER_PORT' => 80,
126
                    'SERVER_NAME' => 'vpn.example',
127
                    'REQUEST_METHOD' => $requestMethod,
128
                    'PATH_INFO' => sprintf('/%s', $pathInfo),
129
                    'REQUEST_URI' => sprintf('/%s', $pathInfo),
130
                    'PHP_AUTH_USER' => $basicAuth[0],
131
                    'PHP_AUTH_PW' => $basicAuth[1],
132
                ],
133
                $getData,
134
                $postData
135
            )
136
        );
137
138
        $responseArray = json_decode($response->getBody(), true)[$pathInfo];
139
        if ($responseArray['ok']) {
140
            if (array_key_exists('data', $responseArray)) {
141
                return $responseArray['data'];
142
            }
143
144
            return true;
145
        }
146
147
        // in case of errors...
148
        return $responseArray;
149
    }
150
}
151

tests/Api/ConnectionsModuleTest.php 1 location

@@ 182-211 (lines=30) @@
179
        );
180
    }
181
182
    private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = [])
183
    {
184
        $response = $this->service->run(
185
            new Request(
186
                [
187
                    'SERVER_PORT' => 80,
188
                    'SERVER_NAME' => 'vpn.example',
189
                    'REQUEST_METHOD' => $requestMethod,
190
                    'PATH_INFO' => sprintf('/%s', $pathInfo),
191
                    'REQUEST_URI' => sprintf('/%s', $pathInfo),
192
                    'PHP_AUTH_USER' => $basicAuth[0],
193
                    'PHP_AUTH_PW' => $basicAuth[1],
194
                ],
195
                $getData,
196
                $postData
197
            )
198
        );
199
200
        $responseArray = json_decode($response->getBody(), true)[$pathInfo];
201
        if ($responseArray['ok']) {
202
            if (array_key_exists('data', $responseArray)) {
203
                return $responseArray['data'];
204
            }
205
206
            return true;
207
        }
208
209
        // in case of errors...
210
        return $responseArray;
211
    }
212
}
213

tests/Api/InfoModuleTest.php 1 location

@@ 92-121 (lines=30) @@
89
        );
90
    }
91
92
    private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = [])
93
    {
94
        $response = $this->service->run(
95
            new Request(
96
                [
97
                    'SERVER_PORT' => 80,
98
                    'SERVER_NAME' => 'vpn.example',
99
                    'REQUEST_METHOD' => $requestMethod,
100
                    'PATH_INFO' => sprintf('/%s', $pathInfo),
101
                    'REQUEST_URI' => sprintf('/%s', $pathInfo),
102
                    'PHP_AUTH_USER' => $basicAuth[0],
103
                    'PHP_AUTH_PW' => $basicAuth[1],
104
                ],
105
                $getData,
106
                $postData
107
            )
108
        );
109
110
        $responseArray = json_decode($response->getBody(), true)[$pathInfo];
111
        if ($responseArray['ok']) {
112
            if (array_key_exists('data', $responseArray)) {
113
                return $responseArray['data'];
114
            }
115
116
            return true;
117
        }
118
119
        // in case of errors...
120
        return $responseArray;
121
    }
122
}
123

tests/Api/UsersModuleTest.php 1 location

@@ 328-357 (lines=30) @@
325
        );
326
    }
327
328
    private function makeRequest(array $basicAuth, $requestMethod, $pathInfo, array $getData = [], array $postData = [])
329
    {
330
        $response = $this->service->run(
331
            new Request(
332
                [
333
                    'SERVER_PORT' => 80,
334
                    'SERVER_NAME' => 'vpn.example',
335
                    'REQUEST_METHOD' => $requestMethod,
336
                    'PATH_INFO' => sprintf('/%s', $pathInfo),
337
                    'REQUEST_URI' => sprintf('/%s', $pathInfo),
338
                    'PHP_AUTH_USER' => $basicAuth[0],
339
                    'PHP_AUTH_PW' => $basicAuth[1],
340
                ],
341
                $getData,
342
                $postData
343
            )
344
        );
345
346
        $responseArray = json_decode($response->getBody(), true)[$pathInfo];
347
        if ($responseArray['ok']) {
348
            if (array_key_exists('data', $responseArray)) {
349
                return $responseArray['data'];
350
            }
351
352
            return true;
353
        }
354
355
        // in case of errors...
356
        return $responseArray;
357
    }
358
}
359