Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
35 | 3 | public function importFromTranslations(Translations $translations) |
|
36 | { |
||
37 | 3 | $locale = $translations->getLanguage(); |
|
38 | 3 | $domain = $translations->getDomain(); |
|
39 | |||
40 | 3 | if (!in_array($locale, $this->config->getLocales())) { |
|
41 | 1 | throw new UnsupportedLocaleException('Locale ' . $locale . ' was not found in config'); |
|
42 | } |
||
43 | |||
44 | 2 | if (!in_array($domain, $this->config->getOtherDomains()) && $domain !== $this->config->getDefaultDomain()) { |
|
45 | 1 | throw new UnsupportedDomainException('Domain ' . $domain . ' was not found in config'); |
|
46 | } |
||
47 | |||
48 | 1 | $this->storage->saveTranslated($translations); |
|
49 | } |
||
50 | } |