Completed
Push — 1.10.x ( 9a71ab...f8e8ec )
by
unknown
50:16
created

Number::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 13
Ratio 100 %
Metric Value
dl 13
loc 13
rs 9.4285
cc 2
eloc 8
nc 2
nop 3
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
/**
5
 * Number element
6
 *
7
 * Class Number
8
 */
9 View Code Duplication
class Number extends HTML_QuickForm_text
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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