Code Duplication    Length = 12-12 lines in 2 locations

src/controllers/FulltextController.php 2 locations

@@ 1145-1156 (lines=12) @@
1142
    /**
1143
     * Save the form submission containing changes to a FTS mapping.
1144
     */
1145
    public function doSaveAlterMapping()
1146
    {
1147
        $data = $this->misc->getDatabaseAccessor();
1148
1149
        $mappingArray = (is_array($_POST['formMapping']) ? $_POST['formMapping'] : [$_POST['formMapping']]);
1150
        $status       = $data->changeFtsMapping($_POST['ftscfg'], $mappingArray, 'alter', $_POST['formDictionary']);
1151
        if (0 == $status) {
1152
            $this->doViewConfig($_POST['ftscfg'], $this->lang['strftsmappingaltered']);
1153
        } else {
1154
            $this->doAlterMapping($this->lang['strftsmappingalteredbad']);
1155
        }
1156
    }
1157
1158
    /**
1159
     * Show the form to enter parameters of a new FTS mapping.
@@ 1228-1239 (lines=12) @@
1225
    /**
1226
     * Save the form submission containing parameters of a new FTS mapping.
1227
     */
1228
    public function doSaveAddMapping()
1229
    {
1230
        $data = $this->misc->getDatabaseAccessor();
1231
1232
        $mappingArray = (is_array($_POST['formMapping']) ? $_POST['formMapping'] : [$_POST['formMapping']]);
1233
        $status       = $data->changeFtsMapping($_POST['ftscfg'], $mappingArray, 'add', $_POST['formDictionary']);
1234
        if (0 == $status) {
1235
            $this->doViewConfig($_POST['ftscfg'], $this->lang['strftsmappingadded']);
1236
        } else {
1237
            $this->doAddMapping($this->lang['strftsmappingaddedbad']);
1238
        }
1239
    }
1240
}
1241