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

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