Completed
Pull Request — master (#29)
by Yann
01:35
created

ConfigurableEnum::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Yokai\Enum;
4
5
/**
6
 * @author Yann Eugoné <[email protected]>
7
 */
8
class ConfigurableEnum implements EnumInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    private $name;
14
15
    /**
16
     * @var array
17
     */
18
    private $choices;
19
20
    /**
21
     * @param string $name
22
     * @param array  $choices
23
     */
24 10
    public function __construct($name, array $choices)
25
    {
26 10
        $this->name = $name;
27 10
        $this->choices = $choices;
28 10
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33 2
    public function getName()
34
    {
35 2
        return $this->name;
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41 6
    public function getChoices()
42
    {
43 6
        return $this->choices;
44
    }
45
}
46