-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor #34019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It looks like reading |
As in: make getCsvOptions() return two extra variables ? |
I tried, but when it was time to update the test, I realized that getCsvOptions() returns a different set of variables in encode() v/s decode(). |
My proposed changes are done, but I don't know how to correct the failing AppVeyor... |
Thank you @savedario. |
…in constructor (Dario Savella) This PR was squashed before being merged into the 4.3 branch. Discussion ---------- [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT My first pull request... The following code: ``` $data = <<<EOD a,b c,d EOD; $encoder = new CsvEncoder([CsvEncoder::NO_HEADERS_KEY=>true]); var_dump($encoder->decode($data,'csv')); ``` produces: ``` array(2) { 'a' => string(1) "c" 'b' => string(1) "d" } ``` instead of the expected: ``` array(2) { [0] => array(2) { [0] => string(1) "a" [1] => string(1) "b" } [1] => array(2) { [0] => string(1) "c" [1] => string(1) "d" } } ``` Commits ------- a0430f6 [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
…n used in constructor (Dario Savella) This PR was squashed before being merged into the 4.3 branch. Discussion ---------- [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT My first pull request... The following code: ``` $data = <<<EOD a,b c,d EOD; $encoder = new CsvEncoder([CsvEncoder::NO_HEADERS_KEY=>true]); var_dump($encoder->decode($data,'csv')); ``` produces: ``` array(2) { 'a' => string(1) "c" 'b' => string(1) "d" } ``` instead of the expected: ``` array(2) { [0] => array(2) { [0] => string(1) "a" [1] => string(1) "b" } [1] => array(2) { [0] => string(1) "c" [1] => string(1) "d" } } ``` Commits ------- a0430f6 [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
My first pull request...
The following code:
produces:
instead of the expected: