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

[Yaml] Stop replacing NULLs when merging#21756

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
xabbuh merged 1 commit intosymfony:2.7fromostrolucky:patch-5
Feb 26, 2017

Conversation

@ostrolucky
Copy link
Contributor

@ostroluckyostrolucky commentedFeb 25, 2017
edited
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

This introduces slight change of behaviour. Whereas previous code is overwriting already processed NULL values, this code is not. I think this is more expected behaviour, though?

@GuilhemN
Copy link
Contributor

What about using array_replace instead ? It would be clearer imo.

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneFeb 25, 2017
@nicolas-grekas
Copy link
Member

There is a difference between the removed and the new code : any pre-existingnull value was overridden previously, but isn't anymore. I don't if that's a bug for or a regression. It would be great to have a test case ensure the correct behavior is tested.

@ostrolucky
Copy link
ContributorAuthor

ostrolucky commentedFeb 25, 2017
edited
Loading

@GuilhemN Yeah it would be clearer since this operator isn't widely used, but array_replace is also slower. I try to make my changes without performance impact. I think we can instead solve this by adding // comment to indicate what we are doing if you wish. What do you guys think?

@nicolas-grekas Yep I'm aware of that. I'll let you guys decide what is correct behaviour, then I will modify my patch appropriately, even if it's only adding the test case. IMO duplicate keys are not supposed to be overwriting any previously set values. In 3.2 there was even deprecated ability to specify duplicate keys. I can even modify this to make this trigger deprecation instead, however I don't know what message is appropriate, since I'm not familiar what does this block of parser do.

@nicolas-grekas
Copy link
Member

The correct behavior is dictated by the yaml spec.@xabbuh or@GuilhemN any hint on that topic?

@GuilhemN
Copy link
Contributor

@nicolas-grekas I didn't check but I don't see any good reason justifiing a different behavior fornull so I think it's a mistake here.

@GuilhemN
Copy link
Contributor

Nothing is said aboutnull so I understand that it should behave the same as any other value.

@nicolas-grekas
Copy link
Member

@gadelat can you add a test case in this direction please?

@ostroluckyostrolucky changed the title[Yaml] Utilize PHP array union operator in a Parser[Yaml] Stop replacing NULLs when mergingFeb 25, 2017
@xabbuh
Copy link
Member

👍 This will solve the initial overlook that didn't take into account thatisset() returnsfalse fornull values.

Status: Reviewed

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

@xabbuh
Copy link
Member

Thank you @gadelat.

@xabbuhxabbuh merged commitd967440 intosymfony:2.7Feb 26, 2017
xabbuh added a commit that referenced this pull requestFeb 26, 2017
This PR was merged into the 2.7 branch.Discussion----------[Yaml] Stop replacing NULLs when merging| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -This introduces slight change of behaviour. Whereas previous code is overwriting already processed NULL values, this code is not. I think this is more expected behaviour, though?Commits-------d967440 [Yaml] Stop replacing NULLs when merging
This was referencedMar 6, 2017
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

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

5 participants

@ostrolucky@GuilhemN@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp