Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:4.3fromsavedario:ignored-no-headers-key
Nov 28, 2019
Merged

[Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor#34019

nicolas-grekas merged 1 commit intosymfony:4.3fromsavedario:ignored-no-headers-key
Nov 28, 2019

Conversation

@savedario
Copy link

@savedariosavedario commentedOct 17, 2019
edited
Loading

QA
Branch?4.3
Bug fix?yes
New feature?no
Deprecations?no
LicenseMIT

My first pull request...
The following code:

$data = <<<EODa,bc,dEOD;$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"  }}

@nicolas-grekas
Copy link
Member

It looks like reading$context[self::AS_COLLECTION_KEY] has the same issue.
Wouldn't it make sense to patch and usegetCsvOptions() instead?

@savedario
Copy link
Author

As in: make getCsvOptions() return two extra variables ?

@savedario
Copy link
Author

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().
The original version seemed less invasive... and AS_COLLECTION_KEY will soon be deprecated.

@savedario
Copy link
Author

My proposed changes are done, but I don't know how to correct the failing AppVeyor...

@nicolas-grekasnicolas-grekas changed the titleCsvEncoder::NO_HEADERS_KEY ignored when used in constructor[Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructorNov 28, 2019
@nicolas-grekas
Copy link
Member

Thank you@savedario.

savedario reacted with thumbs up emoji

nicolas-grekas added a commit that referenced this pull requestNov 28, 2019
…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       | MITMy first pull request...The following code:```$data = <<<EODa,bc,dEOD;$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
@nicolas-grekasnicolas-grekas merged commita0430f6 intosymfony:4.3Nov 28, 2019
@savedariosavedario deleted the ignored-no-headers-key branchNovember 28, 2019 15:30
This was referencedDec 1, 2019
hultberg pushed a commit to hultberg/symfony that referenced this pull requestSep 17, 2021
…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       | MITMy first pull request...The following code:```$data = <<<EODa,bc,dEOD;$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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

4 participants

@savedario@nicolas-grekas@carsonbot@dario-rigpa

[8]ページ先頭

©2009-2025 Movatter.jp