Completed
Pull Request — master (#27)
by Yann
04:26
created

ConfigurableTranslatedEnum::getValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Yokai\EnumBundle\Enum;
4
5
use Symfony\Component\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 4
    public function __construct(TranslatorInterface $translator, $transPattern, $name, array $values)
29
    {
30 4
        parent::__construct($translator, $transPattern);
31
32 3
        $this->name = $name;
33 3
        $this->values = $values;
34 3
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39 1
    public function getName()
40
    {
41 1
        return $this->name;
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47 2
    public function getValues()
48
    {
49 2
        return $this->values;
50
    }
51
}
52