Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
47 | 2 | public function resolveTranslation(string $key): string |
|
48 | { |
||
49 | 2 | $translationKey = Enums::resolveTranslationKey($this, $key); |
|
50 | /** @var string */ |
||
51 | 2 | $translation = Lang::get($translationKey); |
|
52 | |||
53 | 2 | if ($translation !== $translationKey) { |
|
54 | 1 | return $translation; |
|
55 | } |
||
56 | |||
57 | 1 | throw new ValueError(sprintf('The case %s::%s has no "%s" translation set', self::class, $this->name, $key)); |
|
58 | } |
||
60 |