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

ConfigurableEnum   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getChoices() 0 4 1
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