Code Duplication    Length = 13-17 lines in 2 locations

code/Model/EditableFormField/EditableNumericField.php 1 location

@@ 54-66 (lines=13) @@
51
        return $field;
52
    }
53
54
    public function getFieldValidationOptions()
55
    {
56
        $fields = parent::getFieldValidationOptions();
57
        $fields->push(FieldGroup::create(
58
            _t(__CLASS__.'.RANGE', 'Allowed numeric range'),
59
            [
60
                NumericField::create('MinValue', false),
61
                LiteralField::create('RangeValue', _t(__CLASS__.'.RANGE_TO', 'to')),
62
                NumericField::create('MaxValue', false)
63
            ]
64
        ));
65
        return $fields;
66
    }
67
68
    /**
69
     * Updates a formfield with the additional metadata specified by this field

code/Model/EditableFormField/EditableTextField.php 1 location

@@ 107-123 (lines=17) @@
104
    /**
105
     * @return FieldList
106
     */
107
    public function getFieldValidationOptions()
108
    {
109
        $fields = parent::getFieldValidationOptions();
110
111
        $fields->merge([
112
            FieldGroup::create(
113
                _t(__CLASS__.'.TEXTLENGTH', 'Allowed text length'),
114
                [
115
                    NumericField::create('MinLength', false),
116
                    LiteralField::create('RangeLength', _t(__CLASS__.".RANGE_TO", "to")),
117
                    NumericField::create('MaxLength', false)
118
                ]
119
            )
120
        ]);
121
122
        return $fields;
123
    }
124
125
    /**
126
     * @return TextareaField|TextField