Code Duplication    Length = 5-8 lines in 4 locations

Apps/Controller/Front/Feedback.php 1 location

@@ 101-105 (lines=5) @@
98
            // init new answer add model
99
            $model = new FormAnswerAdd($recordPost, $userId);
100
            // if answer is sender lets try to make it model
101
            if ($model->send() && $model->validate()) {
102
                $model->make();
103
                App::$Session->getFlashBag()->add('success', __('Your answer was added'));
104
                $model->clearProperties();
105
            }
106
        }
107
108
        // render output view

Apps/Controller/Front/Profile.php 1 location

@@ 131-138 (lines=8) @@
128
        $model = new FormPasswordChange($user);
129
130
        // check if form is submited and validation is passed
131
        if ($model->send() && $model->validate()) {
132
            $model->make();
133
            App::$Event->run(static::EVENT_CHANGE_PASSWORD, [
134
                'model' => $model
135
            ]);
136
137
            App::$Session->getFlashBag()->add('success', __('Password is successful changed'));
138
        }
139
140
        // set response output
141
        return $this->view->render('password', [

Apps/Controller/Front/Profile/ActionAvatar.php 1 location

@@ 38-45 (lines=8) @@
35
        $model = new FormAvatarUpload(true);
36
37
        // validate model post data
38
        if ($model->send()) {
39
            if ($model->validate()) {
40
                $model->copyFile($user);
41
                App::$Session->getFlashBag()->add('success', __('Avatar is successful changed'));
42
            } else {
43
                App::$Session->getFlashBag()->add('error', __('File upload is failed!'));
44
            }
45
        }
46
47
        return $this->view->render('avatar', [
48
            'user' => $user,

Apps/Controller/Front/Profile/ActionIgnore.php 1 location

@@ 51-57 (lines=7) @@
48
        }
49
50
        // sended new block add?
51
        if ($model->send() && $model->validate()) {
52
            if ($model->save()) {
53
                App::$Session->getFlashBag()->add('success', __('User was successful blocked!'));
54
            } else {
55
                App::$Session->getFlashBag()->add('error', __('This user is always in ignore list'));
56
            }
57
        }
58
59
        // get blocked users
60
        $query = Blacklist::where('user_id', '=', $user->getId());