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 = 18-19 lines in 2 locations

app/Http/Controllers/API/ServerController.php 1 location

@@ 205-222 (lines=18) @@
202
     *      @Parameter("id", type="integer", required=true, description="The ID of the server to modify.")
203
     * })
204
     */
205
    public function build(Request $request, $id)
206
    {
207
        try {
208
            $server = new ServerRepository;
209
            $server->changeBuild($id, $request->only([
210
                'default', 'add_additional', 'remove_additional',
211
                'memory', 'swap', 'io', 'cpu', 'disk',
212
            ]));
213
214
            return Models\Server::findOrFail($id);
215
        } catch (DisplayValidationException $ex) {
216
            throw new ResourceException('A validation error occured.', json_decode($ex->getMessage(), true));
217
        } catch (DisplayException $ex) {
218
            throw new ResourceException($ex->getMessage());
219
        } catch (\Exception $ex) {
220
            throw new ServiceUnavailableHttpException('Unable to update server on system due to an error.');
221
        }
222
    }
223
224
    /**
225
     * Suspend Server.

app/Http/Controllers/API/UserController.php 1 location

@@ 155-173 (lines=19) @@
152
     *         @Parameter("id", type="integer", required=true, description="The ID of the user to modify.")
153
     * })
154
     */
155
    public function update(Request $request, $id)
156
    {
157
        try {
158
            $user = new UserRepository;
159
            $user->update($id, $request->only([
160
                'username', 'email', 'name_first',
161
                'name_last', 'password',
162
                'root_admin', 'language',
163
            ]));
164
165
            return Models\User::findOrFail($id);
166
        } catch (DisplayValidationException $ex) {
167
            throw new ResourceException('A validation error occured.', json_decode($ex->getMessage(), true));
168
        } catch (DisplayException $ex) {
169
            throw new ResourceException($ex->getMessage());
170
        } catch (\Exception $ex) {
171
            throw new ServiceUnavailableHttpException('Unable to update a user on the system due to an error.');
172
        }
173
    }
174
175
    /**
176
     * Delete a User.