Completed
Pull Request — master (#30)
by
unknown
11:11
created

ConfigurableTranslatedEnum   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 42
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getName() 0 4 1
A getValues() 0 4 1
1
<?php
2
3
namespace Yokai\EnumBundle\Enum;
4
5
use Symfony\Contracts\Translation\TranslatorInterface;
6
7
/**
8
 * @author Yann Eugoné <[email protected]>
9
 */
10
class ConfigurableTranslatedEnum extends AbstractTranslatedEnum
11
{
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17
    /**
18
     * @var array
19
     */
20
    private $values;
21
22
    /**
23
     * @param TranslatorInterface $translator
24
     * @param string              $transPattern
25
     * @param string              $name
26
     * @param array               $values
27
     */
28
    public function __construct(TranslatorInterface $translator, $transPattern, $name, array $values)
29
    {
30
        parent::__construct($translator, $transPattern);
31
32
        $this->name = $name;
33
        $this->values = $values;
34
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function getName()
40
    {
41
        return $this->name;
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47
    public function getValues()
48
    {
49
        return $this->values;
50
    }
51
}
52