Code Duplication    Length = 16-16 lines in 2 locations

src/controllers/FulltextController.php 2 locations

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