Conditions | 6 |
Paths | 8 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function assertAllTranslationsFound(): self |
||
31 | { |
||
32 | $missings = array(); |
||
33 | foreach ($this->dataCollectorTranslator->getCollectedMessages() as $message) { |
||
34 | if ($message['state'] === DataCollectorTranslator::MESSAGE_MISSING) { |
||
35 | $missings[] = $message; |
||
36 | } elseif ( |
||
37 | $message['state'] === DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK |
||
38 | && $this->allowFallbacks === false |
||
39 | ) { |
||
40 | $message['locale'] = 'fallback ' . $message['locale'] . ' found '; |
||
41 | $message['locale'] .= 'but not allowed by config dev.translation.allow_fallbacks)'; |
||
42 | $missings[] = $message; |
||
43 | } |
||
44 | } |
||
45 | |||
46 | if (count($missings) > 0) { |
||
47 | throw new TranslationsNotFoundException($missings); |
||
48 | } |
||
49 | |||
50 | return $this; |
||
51 | } |
||
52 | } |
||
53 |