Code Duplication    Length = 21-24 lines in 2 locations

main/inc/lib/formvalidator/Element/Number.php 1 location

@@ 9-29 (lines=21) @@
6
 *
7
 * Class Number
8
 */
9
class Number extends HTML_QuickForm_text
10
{
11
    /**
12
     * @param string $elementName
13
     * @param string $elementLabel
14
     * @param array  $attributes
15
     */
16
    public function __construct($elementName = null, $elementLabel = null, $attributes = null)
17
    {
18
        if (!isset($attributes['id'])) {
19
            $attributes['id'] = $elementName;
20
        }
21
22
        $attributes['type'] = 'number';
23
        $attributes['class'] = 'form-control';
24
25
        parent::__construct($elementName, $elementLabel, $attributes);
26
        $this->_appendName = true;
27
        $this->setType('number');
28
    }
29
}
30

main/inc/lib/formvalidator/Element/Url.php 1 location

@@ 8-31 (lines=24) @@
5
 *
6
 * Class Url
7
 */
8
class Url extends HTML_QuickForm_text
9
{
10
11
    /**
12
     * Constructor of Url class
13
     * @param type $elementName
14
     * @param type $elementLabel
15
     * @param type $attributes
16
     */
17
    public function __construct($elementName = null, $elementLabel = null, $attributes = null)
18
    {
19
        if (!isset($attributes['id'])) {
20
            $attributes['id'] = $elementName;
21
        }
22
23
        $attributes['type'] = 'url';
24
        $attributes['class'] = 'form-control';
25
26
        parent::__construct($elementName, $elementLabel, $attributes);
27
28
        $this->setType('url');
29
    }
30
31
}
32