| Total Complexity | 5 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class TranslationFileNameProvider implements TranslationFileNameProviderInterface |
||
| 14 | { |
||
| 15 | public function getFileName(TranslationValueInterface $translationValue): string |
||
| 16 | { |
||
| 17 | if (null === $translationValue->getTranslation()) { |
||
| 18 | throw new TranslationNotFoundException(); |
||
| 19 | } |
||
| 20 | |||
| 21 | if (null === $translationValue->getTranslation()->getDomainName() || null === $translationValue->getLocaleCode()) { |
||
| 22 | throw new GenerateTranslationFileNameException(); |
||
| 23 | } |
||
| 24 | |||
| 25 | return sprintf('%s.%s.yaml', $translationValue->getTranslation()->getDomainName(), $translationValue->getLocaleCode()); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getFromValues(string $directory, string $domain, string $locale, string $format): string |
||
| 31 | } |
||
| 32 | } |
||
| 33 |