From dfc600ab1bde81cce2db3c06a95ab1e9b170cb79 Mon Sep 17 00:00:00 2001 From: alexandre-butynski Date: Fri, 13 Oct 2017 14:28:30 +0200 Subject: [PATCH] Rename "includeHeader" option to "include_header" --- README.md | 2 +- src/Neoxia/Routing/ResponseFactory.php | 4 ++-- tests/ResponseFactoryTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 29c9955..89257d5 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,6 @@ The default options are the following. 'encoding' => 'WINDOWS-1252', 'delimiter' => ';', 'quoted' => true, - 'includeHeader' => true, + 'include_header' => true, ] ``` diff --git a/src/Neoxia/Routing/ResponseFactory.php b/src/Neoxia/Routing/ResponseFactory.php index ca77a91..8be9973 100644 --- a/src/Neoxia/Routing/ResponseFactory.php +++ b/src/Neoxia/Routing/ResponseFactory.php @@ -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); @@ -78,7 +78,7 @@ protected function formatCsv($data, array $options) } else { $csvArray = []; - if ( $options['includeHeader']) { + if ( $options['include_header']) { $this->addHeaderToCsvArray($csvArray, $data, $options); } diff --git a/tests/ResponseFactoryTest.php b/tests/ResponseFactoryTest.php index 2c96278..efe8a72 100644 --- a/tests/ResponseFactoryTest.php +++ b/tests/ResponseFactoryTest.php @@ -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\""); }