Skip to content
This repository has been archived by the owner on Dec 27, 2017. It is now read-only.

Commit

Permalink
Fix #4, remove enclosure default value.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlins committed Aug 25, 2014
1 parent 12c87b5 commit ae076c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Command/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ protected function configure()
'enclosure',
'e',
InputOption::VALUE_REQUIRED,
'The enclosure is used by the csv and printf format.',
'"'
'The enclosure is used by the csv and printf format.'
)
->addOption(
'escape',
Expand Down Expand Up @@ -216,7 +215,12 @@ protected function outputCsv(InputInterface $input, OutputInterface $output, $da
$stream = fopen('php://temp', 'w+');

foreach ($data as $row) {
fputcsv($stream, $this->flattenArray($row), $delimiter, $enclosure);
if ($enclosure === null) {
fputcsv($stream, $this->flattenArray($row), $delimiter);
}
else {
fputcsv($stream, $this->flattenArray($row), $delimiter, $enclosure);
}
}

fseek($stream, 0);
Expand Down

0 comments on commit ae076c7

Please sign in to comment.