Completed
Push — master ( 325e74...452da7 )
by Dmitry
13:50
created

StaticCombo::setData()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 4.0092

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 11
cts 12
cp 0.9167
rs 9.2
c 0
b 0
f 0
cc 4
eloc 9
nc 4
nop 1
crap 4.0092
1
<?php
2
3
/*
4
 * Combo widget for Yii2
5
 *
6
 * @link      https://github.com/hiqdev/yii2-combo
7
 * @package   yii2-combo
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\combo;
13
14
/**
15
 * Class for Static combo.
16
 *
17
 * @property mixed data
18
 */
19
class StaticCombo extends Combo
20
{
21
    public $name = 'default';
22
23
    public $type = 'default';
24
25
    public $data = [];
26
27
    public function getPluginOptions($options = [])
28
    {
29
        $options = parent::getPluginOptions();
30
        unset($options['select2Options']['ajax']);
31
32
        return $options;
33
    }
34
35
    protected function getCurrentOptions()
36
    {
37
        return $this->data;
38
    }
39
}
40