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

Commit

Permalink
Merge branch 'release/1.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlins committed Aug 25, 2014
2 parents 96e1783 + 277526b commit 84e4e99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a command line tool for easy generation of fake data in a static way.
You can find the latest phar on the [releases page](https://github.com/bit3/faker-cli/releases).

```bash
$ wget https://github.com/bit3/faker-cli/releases/download/1.0.4/faker.phar
$ wget https://github.com/bit3/faker-cli/releases/download/1.0.5/faker.phar
$ ./faker.phar
```

Expand Down
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 84e4e99

Please sign in to comment.