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 = 24-26 lines in 2 locations

app/Http/Controllers/Server/TaskController.php 2 locations

@@ 107-130 (lines=24) @@
104
        return redirect()->route('server.tasks.new', $uuid);
105
    }
106
107
    public function deleteTask(Request $request, $uuid, $id)
108
    {
109
        $server = Models\Server::getByUUID($uuid);
110
        $this->authorize('delete-task', $server);
111
112
        $task = Models\Task::findOrFail($id);
113
114
        if (! $task || $server->id !== $task->server) {
115
            return response()->json([
116
                'error' => 'No task by that ID was found associated with this server.',
117
            ], 404);
118
        }
119
120
        try {
121
            $repo = new Repositories\TaskRepository;
122
            $repo->delete($id);
123
124
            return response()->json([], 204);
125
        } catch (\Exception $ex) {
126
            Log::error($ex);
127
128
            return response()->json([
129
                'error' => 'A server error occured while attempting to delete this task.',
130
            ], 503);
131
        }
132
    }
133
@@ 134-159 (lines=26) @@
131
        }
132
    }
133
134
    public function toggleTask(Request $request, $uuid, $id)
135
    {
136
        $server = Models\Server::getByUUID($uuid);
137
        $this->authorize('toggle-task', $server);
138
139
        $task = Models\Task::findOrFail($id);
140
141
        if (! $task || $server->id !== $task->server) {
142
            return response()->json([
143
                'error' => 'No task by that ID was found associated with this server.',
144
            ], 404);
145
        }
146
147
        try {
148
            $repo = new Repositories\TaskRepository;
149
            $resp = $repo->toggle($id);
150
151
            return response()->json([
152
                'status' => $resp,
153
            ]);
154
        } catch (\Exception $ex) {
155
            Log::error($ex);
156
157
            return response()->json([
158
                'error' => 'A server error occured while attempting to toggle this task.',
159
            ], 503);
160
        }
161
    }
162
}