Code Duplication    Length = 5-5 lines in 3 locations

app/lib/FFCMS/Controllers/Admin/Apps.php 1 location

@@ 153-157 (lines=5) @@
150
            $f3->reroute('@api_apps');
151
        }
152
153
        if ($appsMapper->save()) {
154
            $this->notify(_('The app has been updated!'), 'success');
155
        } else {
156
            $this->notify(_('App update failed!'), 'error');
157
        }
158
159
        $f3->reroute('@admin_apps_list');
160
    }

app/lib/FFCMS/Controllers/User/Apps.php 2 locations

@@ 103-107 (lines=5) @@
100
        $scopes = $f3->get('userScopes');
101
        $appsMapper->status = in_array('admin', $scopes) ? 'approved' : 'registered';
102
103
        if ($appsMapper->save()) {
104
            $this->notify(_('Your new app has been registered!'), 'success');
105
        } else {
106
            $this->notify(_('App registration failed!'), 'error');
107
        }
108
109
        $f3->reroute('@api_apps');
110
    }
@@ 159-163 (lines=5) @@
156
            $f3->reroute('@api_apps');
157
        }
158
159
        if ($appsMapper->save()) {
160
            $this->notify(_('Your app has been updated!'), 'success');
161
        } else {
162
            $this->notify(_('App update failed!'), 'error');
163
        }
164
165
        $f3->reroute('@api_apps');
166
    }