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

HasOptionsTrait::setOption()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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
}