Completed
Push — feature/update_flight ( 289873 )
by Laurent
18:14
created

Select   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getValueOptions() 0 4 1
A setValueOptions() 0 5 1
A setValue() 0 5 1
1
<?php
2
/**
3
 *
4
 */
5
6
namespace flightlog\form;
7
8
/**
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class Select extends BaseInput
12
{
13
14
    /**
15
     * @var array
16
     */
17
    private $valueOptions;
18
19
    /**
20
     * @param string $name
21
     * @param array  $options
22
     */
23
    public function __construct($name, $options = [])
24
    {
25
        parent::__construct($name, FormElementInterface::TYPE_SELECT, $options);
26
        $this->valueOptions = [];
27
    }
28
29
    /**
30
     * @return array
31
     */
32
    public function getValueOptions()
33
    {
34
        return $this->valueOptions;
35
    }
36
37
    /**
38
     * @param array $valueOptions
39
     *
40
     * @return Select
41
     */
42
    public function setValueOptions($valueOptions)
43
    {
44
        $this->valueOptions = $valueOptions;
45
        return $this;
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51
    public function setValue($value)
52
    {
53
        parent::setValue($value);
54
        $this->valueOptions[$value] = $value;
55
    }
56
57
58
}