Options   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setOption() 0 5 1
A __construct() 0 3 1
A getOption() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\LibLifxLan;
4
5
trait Options
6
{
7
    private $options;
8
9 3
    public function __construct(array $options = [])
10
    {
11 3
        $this->options = $options;
12
    }
13
14
    /**
15
     * @param int $option
16
     * @return mixed
17
     */
18 3
    public function getOption(int $option)
19
    {
20 3
        return $this->options[$option] ?? null;
21
    }
22
23
    /**
24
     * @param int $option
25
     * @param mixed $value
26
     * @return $this
27
     */
28 1
    public function setOption(int $option, $value): self
29
    {
30 1
        $this->options[$option] = $value;
31
32 1
        return $this;
33
    }
34
}
35