Passed
Push — 1.10.x ( e22269...acc912 )
by
unknown
49:56
created

Url::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 13
Ratio 100 %
Metric Value
dl 13
loc 13
rs 9.4285
cc 2
eloc 7
nc 2
nop 3
1
<?php
2
/* For licensing terms, see /license.txt */
3
/**
4
 * Url element
5
 *
6
 * Class Url
7
 */
8 View Code Duplication
class Url 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...
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