Passed
Push — 1.11.x ( 5018a2...14798e )
by Yannick
10:31
created

InternalUrl   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
/**
5
 * InternalUrl element (URL without the domain as prefix).
6
 *
7
 * Class InternalUrl
8
 */
9
class InternalUrl extends HTML_QuickForm_text
10
{
11
    /**
12
     * InternalUrl constructor.
13
     *
14
     * @param string $elementName
15
     * @param string $elementLabel
16
     * @param array  $attributes
17
     */
18
    public function __construct($elementName = null, $elementLabel = null, $attributes = null)
19
    {
20
        if (!isset($attributes['id'])) {
21
            $attributes['id'] = $elementName;
22
        }
23
24
        $attributes['type'] = 'text';
25
        $attributes['class'] = 'form-control';
26
27
        parent::__construct($elementName, $elementLabel, $attributes);
28
29
        $this->setType('text');
30
    }
31
}
32