Completed
Pull Request — master (#29)
by Yann
12:40
created

ConfigurableTranslatedEnum::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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