| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | private function translate(LocalizationInfo $localizationInfo): string |
||
| 18 | { |
||
| 19 | $replacements = []; |
||
| 20 | foreach ($localizationInfo->getReplacements() as $key => $value) { |
||
| 21 | if (is_array($value)) { |
||
| 22 | $replacements[$key] = json_encode($value); |
||
| 23 | } else { |
||
| 24 | $replacements[$key] = $value; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | $messageString = $localizationInfo->getMessageString(); |
||
| 28 | if (strpos($messageString, '::') === false) { |
||
| 29 | $messageString = 'apie::' . $messageString; |
||
| 30 | } |
||
| 31 | return $this->translator->choice( |
||
| 32 | $messageString, |
||
| 33 | $localizationInfo->getAmount(), |
||
| 34 | $replacements |
||
| 35 | ); |
||
| 38 |