| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function write(array $fields) |
||
| 34 | { |
||
| 35 | $options = $this->getCsvControl(); |
||
| 36 | $delimiter = $options[0]; |
||
| 37 | $enclosure = $options[1]; |
||
| 38 | if (!empty($enclosure)) { |
||
| 39 | return $this->fputcsv($fields, $delimiter, $enclosure); |
||
| 40 | } |
||
| 41 | |||
| 42 | $fields = array_map(function ($field) use ($delimiter, $enclosure) { |
||
|
|
|||
| 43 | return str_replace([$delimiter, PHP_EOL], ['', ''], $field); |
||
| 44 | }, $fields); |
||
| 45 | |||
| 46 | return $this->fwrite(implode($delimiter, $fields) . PHP_EOL); |
||
| 47 | } |
||
| 49 |
This check looks for imports that have been defined, but are not used in the scope.