Code Duplication    Length = 33-33 lines in 2 locations

src/module/Galleries/One/Admin/AddForm.php 1 location

@@ 8-40 (lines=33) @@
5
use Rudolf\Component\Alerts\Alert;
6
use Rudolf\Component\Alerts\AlertsCollection;
7
8
class AddForm extends FormCheck
9
{
10
    /**
11
     * @var AddModel
12
     */
13
    protected $model;
14
15
    /**
16
     * @param AddModel $model
17
     */
18
    public function setModel(AddModel $model)
19
    {
20
        $this->model = $model;
21
    }
22
23
    /**
24
     * @return int
25
     * @throws \Exception
26
     */
27
    public function add()
28
    {
29
        $status = $this->model->add($this->dataValidated);
30
31
        if ($status) {
32
            AlertsCollection::add(new Alert(
33
                'success',
34
                'Pomyślnie dodano galerię.'
35
            ));
36
        }
37
38
        return $status;
39
    }
40
}
41

src/module/Galleries/One/Admin/EditForm.php 1 location

@@ 8-40 (lines=33) @@
5
use Rudolf\Component\Alerts\Alert;
6
use Rudolf\Component\Alerts\AlertsCollection;
7
8
class EditForm extends FormCheck
9
{
10
    /**
11
     * @var EditModel
12
     */
13
    protected $model;
14
15
    /**
16
     * @param EditModel $model
17
     */
18
    public function setModel(EditModel $model)
19
    {
20
        $this->model = $model;
21
    }
22
23
    /**
24
     * @return int
25
     * @throws \Exception
26
     */
27
    public function update()
28
    {
29
        $status = $this->model->update($this->dataValidated);
30
31
        if ($status) {
32
            AlertsCollection::add(new Alert(
33
                'success',
34
                'Pomyślnie zmodyfikowano galerię.'
35
            ));
36
        }
37
38
        return $status;
39
    }
40
}
41