Completed
Push — master ( df042f...f388c6 )
by Yann
07:02 queued 05:41
created

ConfigurableEnum::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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