Conditions | 6 |
Paths | 8 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function assertAllTranslationsFound() |
||
39 | { |
||
40 | $missings = array(); |
||
41 | foreach ($this->dataCollectorTranslator->getCollectedMessages() as $message) { |
||
42 | if ($message['state'] === DataCollectorTranslator::MESSAGE_MISSING) { |
||
43 | $missings[] = $message; |
||
44 | } elseif ( |
||
45 | $message['state'] === DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK |
||
46 | && $this->allowFallbacks === false |
||
47 | ) { |
||
48 | $message['locale'] = 'fallback ' . $message['locale'] . ' found '; |
||
49 | $message['locale'] .= 'but not allowed by config dev.translation.allow_fallbacks)'; |
||
50 | $missings[] = $message; |
||
51 | } |
||
52 | } |
||
53 | |||
54 | if (count($missings) > 0) { |
||
55 | throw new TranslationsNotFoundException($missings); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 |