Options   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A __construct() 0 4 1
A getParams() 0 3 1
1
<?php
2
3
namespace Lincable\Parsers;
4
5
use Lincable\Contracts\Parsers\ParameterInterface;
6
7
class Options implements ParameterInterface
8
{
9
    /**
10
     * The options value name.
11
     *
12
     * @var string
13
     */
14
    protected $value;
15
16
    /**
17
     * The options parameters.
18
     *
19
     * @var array
20
     */
21
    protected $params;
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 46
    public function __construct(string $value, $params = null)
27
    {
28 46
        $this->value = $value;
29 46
        $this->params = array_wrap($params);
30 46
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 42
    public function getValue(): string
36
    {
37 42
        return $this->value;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43 42
    public function getParams(): array
44
    {
45 42
        return $this->params;
46
    }
47
}
48