From ae076c7e4af0032a00943f51bf7d8a06e98ce95b Mon Sep 17 00:00:00 2001 From: Tristan Lins Date: Mon, 25 Aug 2014 09:35:40 +0200 Subject: [PATCH] Fix #4, remove enclosure default value. --- src/Command/GenerateCommand.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Command/GenerateCommand.php b/src/Command/GenerateCommand.php index 16613d8..44fac4e 100644 --- a/src/Command/GenerateCommand.php +++ b/src/Command/GenerateCommand.php @@ -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', @@ -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);