Code Duplication    Length = 10-12 lines in 2 locations

app/controllers/ControllerBase.php 1 location

@@ 95-104 (lines=10) @@
92
    }
93
94
    //PErmet l'édition d'un seul champ à la fois
95
    public function soloUpdateAction()
96
    {
97
        $name = $this->request->getPost('name', 'string');
98
        //Créer la fonction variable 'set' en fonction du name en POST
99
        $func = 'set' . ucfirst($name);
100
        $projet = call_user_func($this->model . '::findFirst', $_POST['pk']);
101
        $projet->$func($_POST['value']);
102
        $projet->save();
103
104
    }
105
106
107
    public function deleteAction($id = null)

app/controllers/TachesController.php 1 location

@@ 24-35 (lines=12) @@
21
22
    }
23
24
    public function soloUpdateAction()
25
    {
26
27
        $name = $this->request->getPost('name', 'string');
28
        //Cr�er la fonction variable 'set' en fonction du name en POST
29
        $func = 'set' . ucfirst($name);
30
        $projet = call_user_func($this->model . '::findFirst', $_POST['pk']);
31
        $projet->$func($_POST['value']);
32
        $projet->save();
33
34
        $this->useCaseUpdate($projet);
35
    }
36
37
    public function deleteAction($id = null)
38
    {