Total Complexity | 4 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait HasOptionsTrait |
||
10 | { |
||
11 | protected $_options; |
||
12 | |||
13 | /** |
||
14 | * @param $key |
||
15 | * @param $value |
||
16 | * @return $this |
||
17 | */ |
||
18 | 2 | public function setOption($key, $value) |
|
19 | { |
||
20 | 2 | $key = (string)$key; |
|
21 | 2 | $this->_options[$key] = $value; |
|
22 | |||
23 | 2 | return $this; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param string $key |
||
28 | * @return bool |
||
29 | */ |
||
30 | 6 | public function hasOption($key) |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $key |
||
39 | * @return null |
||
40 | */ |
||
41 | 3 | public function getOption($key) |
|
49 | } |
||
50 | } |
||
51 |