Passed
Push — master ( acf3f9...98cfe3 )
by Derek Stephen
03:04
created

HasOptionsTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 40
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getOption() 0 3 1
A getOptions() 0 3 1
A setOption() 0 4 1
A setOptions() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: DM0C60544
5
 * Date: 15/12/2016
6
 * Time: 10:41 AM
7
 */
8
9
namespace Del\Form\Traits;
10
11
12
trait HasOptionsTrait
13
{
14
    /** @var array $options */
15
    private $options = [];
16
17
    /**
18
     * @return array
19
     */
20 22
    public function getOptions()
21
    {
22 22
        return $this->options;
23
    }
24
25
    /**
26
     * @param array $options
27
     * @return $this
28
     */
29 24
    public function setOptions($options)
30
    {
31 24
        $this->options = $options;
32 24
        return $this;
33
    }
34
35
    /**
36
     * @return array
37
     */
38 2
    public function getOption($key)
39
    {
40 2
        return $this->options[$key];
41
    }
42
43
    /**
44
     * @param $key
45
     * @param $value
46
     * @return $this
47
     */
48 2
    public function setOption($key, $value)
49
    {
50 2
        $this->options[$key] = $value;
51 2
        return $this;
52
    }
53
}