Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function write($filePath, $data, $append = false) |
||
22 | { |
||
23 | $this->createDirectory($filePath); |
||
24 | |||
25 | if ($append) { |
||
26 | $filePointer = fopen($filePath, 'a'); |
||
27 | } else { |
||
28 | $filePointer = fopen($filePath, 'w'); |
||
29 | } |
||
30 | |||
31 | foreach ($data as $row) { |
||
32 | fputcsv($filePointer, $row, static::DELIMITER); |
||
33 | } |
||
34 | |||
35 | fclose($filePointer); |
||
36 | } |
||
38 |