Code Duplication    Length = 9-10 lines in 3 locations

app/Http/Controllers/ProjectController.php 2 locations

@@ 248-257 (lines=10) @@
245
     *
246
     * @return \Symfony\Component\HttpFoundation\Response
247
     */
248
    public function postAssign(Project $project, Request $request)
249
    {
250
        $status = false;
251
        if ($request->has('user_id')) {
252
            $project->assignUser((int) $request->input('user_id'));
253
            $status = true;
254
        }
255
256
        return response()->json(['status' => $status]);
257
    }
258
259
    /**
260
     * Ajax: remove user from the project.
@@ 267-276 (lines=10) @@
264
     *
265
     * @return \Symfony\Component\HttpFoundation\Response
266
     */
267
    public function postUnassign(Project $project, Request $request)
268
    {
269
        $status = false;
270
        if ($request->has('user_id')) {
271
            $project->unassignUser((int) $request->input('user_id'));
272
            $status = true;
273
        }
274
275
        return response()->json(['status' => $status]);
276
    }
277
278
    /**
279
     * To add a new note to the project.

app/Http/Controllers/Project/IssueController.php 1 location

@@ 68-76 (lines=9) @@
65
     *
66
     * @return \Symfony\Component\HttpFoundation\Response
67
     */
68
    public function postAssign(Issue $issue, Request $request)
69
    {
70
        $response = ['status' => false];
71
        if ($issue->reassign((int) $request->input('user_id'), $this->auth->user()->id)) {
72
            $response['status'] = true;
73
        }
74
75
        return response()->json($response);
76
    }
77
78
    /**
79
     * Ajax: save comment.