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

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