Code Duplication    Length = 9-10 lines in 3 locations

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

@@ 77-85 (lines=9) @@
74
     *
75
     * @return \Symfony\Component\HttpFoundation\Response
76
     */
77
    public function postAssign(Issue $issue, Request $request)
78
    {
79
        $response = ['status' => false];
80
        if ($issue->reassign((int) $request->input('user_id'), $this->auth->user()->id)) {
81
            $response['status'] = true;
82
        }
83
84
        return response()->json($response);
85
    }
86
87
    /**
88
     * Ajax: save comment

app/Http/Controllers/ProjectController.php 2 locations

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