Code Duplication    Length = 6-6 lines in 2 locations

system/modules/Ui/widgets/Form/autocomplete.php 1 location

@@ 8-13 (lines=6) @@
5
echo $label !== false ? "<label>{$label}</label>" : '';
6
$value = !empty($options['value']) ? addcslashes($options['value'], "'") : (!empty($form->userDataTree[$name]) ? addcslashes($form->userDataTree[$name], "'") : '');
7
$displayValue = '';
8
if ($value && isset($options['snippet']) && is_string($options['snippet'])) {
9
    $snippets = App::$cur->Ui->getSnippets('autocomplete');
10
    if (isset($snippets[$options['snippet']])) {
11
        $displayValue = $snippets[$options['snippet']]['getValueText']($value, $options['snippetParams']);
12
    }
13
}
14
?>
15
<input <?= !empty($options['required']) ? 'required' : ''; ?>
16
        id='<?= $id; ?>'

system/Inji/Model.php 1 location

@@ 184-189 (lines=6) @@
181
        switch ($type) {
182
            case 'autocomplete':
183
                $options = $colInfo['colParams']['options'];
184
                if (isset($options['snippet']) && is_string($options['snippet'])) {
185
                    $snippets = \App::$cur->Ui->getSnippets('autocomplete');
186
                    if (isset($snippets[$options['snippet']])) {
187
                        $value = $snippets[$options['snippet']]['getValueText']($item->$colName, $options['snippetParams']);
188
                    }
189
                }
190
                break;
191
            case 'select':
192
                switch ($colInfo['colParams']['source']) {