Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
12 | public static function toString(Translations $translations) |
||
13 | { |
||
14 | $handle = fopen('php://memory', 'w'); |
||
15 | |||
16 | foreach ($translations as $translation) { |
||
17 | fputcsv($handle, [$translation->getOriginal(), $translation->getTranslation()]); |
||
18 | } |
||
19 | |||
20 | rewind($handle); |
||
21 | $csv = stream_get_contents($handle); |
||
22 | |||
23 | fclose($handle); |
||
24 | |||
25 | return $csv; |
||
26 | } |
||
27 | } |
||
28 |