Code Duplication    Length = 15-18 lines in 2 locations

app/Http/Controllers/Task/TaskController.php 1 location

@@ 320-334 (lines=15) @@
317
    /**
318
     * Validate and update a task.
319
     */
320
    public function update()
321
    {
322
        $task = $this->getTask();
323
        $values = $this->request->getValues();
324
325
        list($valid, $errors) = $this->taskValidator->validateModification($values);
326
327
        if ($valid && $this->taskModel->update($values)) {
328
            $this->flash->success(t('Task updated successfully.'));
329
            $this->response->redirect($this->helper->url->to('Task/TaskController', 'show', ['project_id' => $task['project_id'], 'task_id' => $task['id']]), true);
330
        } else {
331
            $this->flash->failure(t('Unable to update your task.'));
332
            $this->edit($values, $errors);
333
        }
334
    }
335
336
    /**
337
     * Duplicate created tasks to multiple projects.

app/Http/Controllers/Manage/ProjectTagController.php 1 location

@@ 62-79 (lines=18) @@
59
    /**
60
     * Validate and save a new project tag.
61
     */
62
    public function store()
63
    {
64
        $project = $this->getProject();
65
        $values = $this->request->getValues();
66
        list($valid, $errors) = $this->tagValidator->validateCreation($values);
67
68
        if ($valid) {
69
            if ($this->tagModel->create($project['id'], $values['name']) > 0) {
70
                $this->flash->success(t('Tag created successfully.'));
71
            } else {
72
                $this->flash->failure(t('Unable to create this tag.'));
73
            }
74
75
            $this->response->redirect($this->helper->url->to('Manage/ProjectTagController', 'index', ['project_id' => $project['id']]));
76
        } else {
77
            $this->create($values, $errors);
78
        }
79
    }
80
81
    /**
82
     * Show form to update a project tag.