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

src/OAuthClient.php 3 locations

@@ 190-194 (lines=5) @@
187
        }
188
189
        // make sure we have an access token
190
        if (false === $accessToken = $this->tokenStorage->getAccessToken($this->userId, $this->providerId, $requestScope)) {
191
            $this->logger->info(sprintf('no access_token available for user "%s" with scope "%s"', $this->userId, $requestScope));
192
193
            return false;
194
        }
195
196
        if ($requestScope !== $accessToken->getScope()) {
197
            throw new OAuthException('access_token does not have the required scope');
@@ 204-211 (lines=8) @@
201
        if ($accessToken->isExpired($this->dateTime)) {
202
            $this->logger->info(sprintf('access_token for user "%s" with scope "%s" expired', $this->userId, $requestScope));
203
            // access_token is expired, try to refresh it
204
            if (is_null($accessToken->getRefreshToken())) {
205
                $this->logger->info(sprintf('no refresh_token available in this access_token for user "%s" with scope "%s", deleting it', $this->userId, $requestScope));
206
                // we do not have a refresh_token, delete this access token, it
207
                // is useless now...
208
                $this->tokenStorage->deleteAccessToken($this->userId, $this->providerId, $accessToken);
209
210
                return false;
211
            }
212
213
            $this->logger->info(sprintf('using refresh_token to obtain new access_token for user "%s" with scope "%s"', $this->userId, $requestScope));
214
@@ 232-238 (lines=7) @@
229
        $request->setHeader('Authorization', sprintf('Bearer %s', $accessToken->getToken()));
230
231
        $response = $this->httpClient->send($request);
232
        if (401 === $response->getStatusCode()) {
233
            $this->logger->info(sprintf('deleting access_token for user "%s" with scope "%s" that was supposed to work, but did not, possibly revoked by user', $this->userId, $requestScope));
234
            // this indicates an invalid access_token
235
            $this->tokenStorage->deleteAccessToken($this->userId, $this->providerId, $accessToken);
236
237
            return false;
238
        }
239
240
        $this->logger->info(sprintf('access_token for use "%s" with scope "%s" successfully used', $this->userId, $requestScope));
241