Code Duplication    Length = 10-10 lines in 2 locations

main/inc/lib/formvalidator/FormValidator.class.php 2 locations

@@ 204-213 (lines=10) @@
201
     * @param bool   $required
202
     * @param array  $attributes
203
     */
204
    public function addDateRangePicker($name, $label, $required = true, $attributes = array())
205
    {
206
        $this->addElement('date_range_picker', $name, $label, $attributes);
207
        $this->addElement('hidden', $name.'_start');
208
        $this->addElement('hidden', $name.'_end');
209
210
        if ($required) {
211
            $this->addRule($name, get_lang('ThisFieldIsRequired'), 'required');
212
        }
213
    }
214
215
    /**
216
     * @param string $name
@@ 1289-1298 (lines=10) @@
1286
     * @param bool $required Optional. Is the form-element required (default=true)
1287
     * @param array $attributes Optional. List of attributes for the form-element
1288
     */
1289
    public function addUrl($name, $label, $required = true, $attributes = array())
1290
    {
1291
        $this->addElement('url', $name, $label, $attributes);
1292
        $this->applyFilter($name, 'trim');
1293
        $this->addRule($name, get_lang('InsertAValidUrl'), 'url');
1294
1295
        if ($required) {
1296
            $this->addRule($name, get_lang('ThisFieldIsRequired'), 'required');
1297
        }
1298
    }
1299
1300
    /**
1301
     * Adds a text field for letters to the form.