Conditions | 4 |
Paths | 5 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function export($file, MessageCatalogue $translations, $domain) |
||
23 | { |
||
24 | if (pathinfo($file, PATHINFO_EXTENSION) === 'xlf') { |
||
25 | $xlfDumper = new XliffFileDumper(); |
||
26 | try { |
||
27 | $xlfContent = $xlfDumper->formatCatalogue($translations, $domain); |
||
28 | if ($xlfContent !== false) { |
||
29 | return (file_put_contents($file, $xlfContent) !== false); |
||
30 | } |
||
31 | } catch (\Exception $e) { |
||
32 | return false; |
||
33 | } |
||
34 | } |
||
35 | |||
36 | return false; |
||
37 | } |
||
38 | |||
39 | } |