Code Duplication    Length = 5-6 lines in 3 locations

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

@@ 131-136 (lines=6) @@
128
        }
129
130
        // check app name exists
131
        if (!$appsMapper->load(['LOWER(client_id) = LOWER(?) AND users_uuid = ?',
132
                $request['client_id'], $f3->get('uuid')])) {
133
            $this->notify(_('The app does not exist!'), 'warning');
134
            $f3->reroute('@api_apps');
135
            return;
136
        }
137
138
        // check required fields
139
        $appsMapper->copyfrom($f3->get('REQUEST'));

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

@@ 129-133 (lines=5) @@
126
        }
127
128
        // check app name exists
129
        if (!$mapper->load(['LOWER(uuid) = LOWER(?)', $request['uuid']])) {
130
            $this->notify(_('The app does not exist!'), 'warning');
131
            $f3->reroute('@api_tokens');
132
            return;
133
        }
134
135
        // check required fields
136
        $mapper->copyfrom($f3->get('REQUEST'));

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

@@ 141-146 (lines=6) @@
138
        }
139
140
        // check app name exists
141
        if (!$appsMapper->load(['LOWER(client_id) = LOWER(?) AND users_uuid = ?',
142
                $request['client_id'], $f3->get('uuid')])) {
143
            $this->notify(_('The app does not exist!'), 'warning');
144
            $f3->reroute('@api_apps');
145
            return;
146
        }
147
148
        // check required fields
149
        $appsMapper->copyfrom($f3->get('REQUEST'));