Code Duplication    Length = 16-16 lines in 2 locations

src/controllers/FulltextController.php 2 locations

@@ 1213-1228 (lines=16) @@
1210
    /**
1211
     * Save the form submission containing changes to a FTS mapping
1212
     */
1213
    public function doSaveAlterMapping()
1214
    {
1215
        $conf = $this->conf;
1216
        $misc = $this->misc;
1217
        $lang = $this->lang;
1218
        $data = $misc->getDatabaseAccessor();
1219
1220
        $mappingArray = (is_array($_POST['formMapping']) ? $_POST['formMapping'] : [$_POST['formMapping']]);
1221
        $status       = $data->changeFtsMapping($_POST['ftscfg'], $mappingArray, 'alter', $_POST['formDictionary']);
1222
        if ($status == 0) {
1223
            $this->doViewConfig($_POST['ftscfg'], $lang['strftsmappingaltered']);
1224
        } else {
1225
            $this->doAlterMapping($lang['strftsmappingalteredbad']);
1226
        }
1227
    }
1228
1229
    /**
1230
     * Show the form to enter parameters of a new FTS mapping
1231
     */
@@ 1306-1321 (lines=16) @@
1303
    /**
1304
     * Save the form submission containing parameters of a new FTS mapping
1305
     */
1306
    public function doSaveAddMapping()
1307
    {
1308
        $conf = $this->conf;
1309
        $misc = $this->misc;
1310
        $lang = $this->lang;
1311
        $data = $misc->getDatabaseAccessor();
1312
1313
        $mappingArray = (is_array($_POST['formMapping']) ? $_POST['formMapping'] : [$_POST['formMapping']]);
1314
        $status       = $data->changeFtsMapping($_POST['ftscfg'], $mappingArray, 'add', $_POST['formDictionary']);
1315
        if ($status == 0) {
1316
            $this->doViewConfig($_POST['ftscfg'], $lang['strftsmappingadded']);
1317
        } else {
1318
            $this->doAddMapping($lang['strftsmappingaddedbad']);
1319
        }
1320
    }
1321
}
1322