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 = 12-15 lines in 2 locations

app/Http/Controllers/Base/APIController.php 1 location

@@ 76-87 (lines=12) @@
73
        return redirect()->route('account.api.new')->withInput();
74
    }
75
76
    public function revoke(Request $request, $key)
77
    {
78
        try {
79
            $repo = new APIRepository($request->user());
80
            $repo->revoke($key);
81
82
            return response('', 204);
83
        } catch (\Exception $ex) {
84
            return response()->json([
85
                'error' => 'An error occured while attempting to remove this key.',
86
            ], 503);
87
        }
88
    }
89
}
90

app/Http/Controllers/Admin/LocationsController.php 1 location

@@ 79-93 (lines=15) @@
76
        return response('', 204);
77
    }
78
79
    public function patchLocation(Request $request, $id)
80
    {
81
        try {
82
            $location = new LocationRepository;
83
            $location->edit($id, $request->all());
84
85
            return response('', 204);
86
        } catch (DisplayValidationException $ex) {
87
            return response()->json([
88
                'error' => 'There was a validation error while processing this request. Location descriptions must be between 1 and 255 characters, and the location code must be between 1 and 10 characters with no spaces or special characters.',
89
            ], 422);
90
        } catch (\Exception $ex) {
91
            // This gets caught and processed into JSON anyways.
92
            throw $ex;
93
        }
94
    }
95
96
    public function postLocation(Request $request)