Completed
Push — master ( db8d28...797ef7 )
by wen
11:20
created

Select   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 39
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getOptions() 0 4 1
A setOptions() 0 5 1
A toArray() 0 6 1
1
<?php
2
3
namespace Sco\Admin\View\Filters;
4
5
class Select extends Filter
6
{
7
    protected $type = 'select';
8
9
    protected $options;
10
11
    public function __construct($name, $title, $options = null)
12
    {
13
        parent::__construct($name, $title);
14
15
        $this->setOptions($options);
16
    }
17
18
    /**
19
     * @return mixed
20
     */
21
    public function getOptions()
22
    {
23
        return $this->options;
24
    }
25
26
    /**
27
     * @param mixed $options
28
     *
29
     * @return Select
30
     */
31
    public function setOptions($options)
32
    {
33
        $this->options = $options;
34
        return $this;
35
    }
36
37
    public function toArray()
38
    {
39
        return parent::toArray() + [
40
                'options' => $this->getOptions(),
41
            ];
42
    }
43
}
44