Passed
Push — dev ( 8f807e...d72849 )
by Yan
02:28
created

Options   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 39
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
    public function __construct(string $value, $params = null)
27
    {
28
        $this->value = $value;
29
        $this->params = array_wrap($params);
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35
    public function getValue(): string
36
    {
37
        return $this->value;
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function getParams(): array
44
    {
45
       return $this->params; 
46
    }
47
}