protected function renderCsv($rows, $header, $delimiter = ',', $enclosure = '"')
{
if ($this->output instanceof StreamOutput) {
$stream = $this->output->getStream();
} else {
throw new \RuntimeException('A stream output is required for the CSV format');
}
if ($header) {
fputcsv($stream, $header, $delimiter, $enclosure);
}
foreach ($rows as $row) {
fputcsv($stream, $row, $delimiter, $enclosure);
}
}