SelectizeDropDownList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 10 2
1
<?php
2
/**
3
 * @link https://github.com/2amigos/yii2-selectize-widget
4
 * @copyright Copyright (c) 2013-2017 2amigOS! Consulting Group LLC
5
 * @license http://opensource.org/licenses/BSD-3-Clause
6
 */
7
8
namespace dosamigos\selectize;
9
10
use yii\helpers\Html;
11
12
/**
13
 * SelectizeDropDownList
14
 *
15
 * @author 2amigos.us <[email protected]>
16
 */
17
class SelectizeDropDownList extends InputWidget
18
{
19
    /**
20
     * @var array
21
     */
22
    public $items = [];
23
24
    /**
25
     * @inheritdoc
26
     */
27 3
    public function run()
28
    {
29 3
        if ($this->hasModel()) {
30 3
            echo Html::activeDropDownList($this->model, $this->attribute, $this->items, $this->options);
31 1
        } else {
32 3
            echo Html::dropDownList($this->name, $this->value, $this->items, $this->options);
33
        }
34
35 3
        parent::run();
36 3
    }
37
}
38