Skip to content

Commit

Permalink
Rename "includeHeader" option to "include_header"
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-butynski committed Oct 13, 2017
1 parent ad95ada commit dfc600a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ The default options are the following.
'encoding' => 'WINDOWS-1252',
'delimiter' => ';',
'quoted' => true,
'includeHeader' => true,
'include_header' => true,
]
```
4 changes: 2 additions & 2 deletions src/Neoxia/Routing/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function parseOptions(array $customOptions)
'encoding' => 'WINDOWS-1252',
'delimiter' => ';',
'quoted' => true,
'includeHeader' => true,
'include_header' => true,
];

return array_merge($baseOptions, $customOptions);
Expand Down Expand Up @@ -78,7 +78,7 @@ protected function formatCsv($data, array $options)
} else {
$csvArray = [];

if ( $options['includeHeader']) {
if ( $options['include_header']) {
$this->addHeaderToCsvArray($csvArray, $data, $options);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ResponseFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function testCsvCanFormatWithoutHeader()
{
$data = [['first_name' => 'John', 'last_name' => 'Doe']];

$response = $this->responseFactory->csv($data, 200, [], ['includeHeader' => false]);
$response = $this->responseFactory->csv($data, 200, [], ['include_header' => false]);

$this->assertCsvResponseIsValidAndEquals($response, "\"John\";\"Doe\"");
}
Expand Down

0 comments on commit dfc600a

Please sign in to comment.