Passed
Push — master ( 3b1e15...43df0a )
by Dmytro
04:55
created

UIDropDown   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 44
rs 10
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
namespace Asymptix\ui\components;
4
5
/**
6
 * DropBox UI component class.
7
 *
8
 * @category Asymptix PHP Framework
9
 * @author Dmytro Zarezenko <[email protected]>
10
 * @copyright (c) 2009 - 2016, Dmytro Zarezenko
11
 *
12
 * @git https://github.com/Asymptix/Framework
13
 * @license http://opensource.org/licenses/MIT
14
 */
15
class UIDropDown extends \Asymptix\ui\UIComponent {
16
    /**
17
     * Default drop-down list HTML template.
18
     */
19
    const DEFAULT_TEMPLATE = "classes/ui_/_templates/components/ui_dropdown.tpl.php";
20
21
    /**
22
     * Makes the select field focused on page load (empty or 'autofocus', optional).
23
     *
24
     * @var string
25
     */
26
    public $autofocus = "";
27
28
    /**
29
     * When true (not empty), it disables the drop-down list (empty or 'disabled',
30
     *           optional).
31
     *
32
     * @var string
33
     */
34
    public $disabled = "";
35
36
    /**
37
     * Defines one ore more forms the select field belongs to (optional).
38
     *
39
     * @var string
40
     */
41
    public $form = "";
42
43
    /**
44
     * Generate HTML of the list <select> element for drop-down list.
45
     *
46
     * @param array<mixed> $dataSet List of drop-down options data.
47
     * @param string,integer $currentValue Current value if selected.
0 ignored issues
show
Documentation introduced by
The doc-type string,integer could not be parsed: Expected "|" or "end of type", but got "," at position 6. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
48
     * @param array<string => string> $attributesList List of the HTML attributes
49
     *           for the drop-down element (optional).
50
     * @param string $template Path to the template file of the drop-down (optional).
51
     */
52
    public function __construct($dataSet = [], $currentValue = null, $attributesList = [], $template = "") {
53
        if (empty($template)) {
54
            $template = self::DEFAULT_TEMPLATE;
55
        }
56
        parent::__construct($attributesList, $template, $dataSet, $currentValue);
57
    }
58
}
59