8000 [Yaml] added ability for substitute aliases when mapping is on single line by xabbuh · Pull Request #25043 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] added ability for substitute aliases when mapping is on single line #25043

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

Merged
merged 2 commits into from
Nov 23, 2017

Conversation

xabbuh
Copy link
Member
@xabbuh xabbuh commented Nov 20, 2017
Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #11569
License MIT
Doc PR

// But overwriting is allowed when a merge node is used in current block.
if ('<<' === $key) {
$output += $value;
} elseif ($allowOverwrite || !isset($output[$key])) {
Copy link
Member

Choose a reason for hiding this comment

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

These conditions are a bit hard to understand because above you have this: if ('<<' === $key) { $allowOverwrite = true; }. So, if('<<' === $key) and if($allowOverwrite) are interchangeable and this if ... elseif is a bit confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

This part is executed several times (for each entry in the mapping). So $allowOverwrite can be true in a subsequent iteration where $key is different from <<.

Copy link
Member Author

Choose a reason for hiding this comment

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

@javiereguiluz Is there still anything you would like to see changed?

@fabpot
Copy link
Member
fabpot commented Nov 23, 2017

Thank you @xabbuh.

@fabpot fabpot merged commit dd26c80 into symfony:2.7 Nov 23, 2017
fabpot added a commit that referenced this pull request Nov 23, 2017
…s on single line (Michał Strzelecki, xabbuh)

This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] added ability for substitute aliases when mapping is on single line

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11569
| License       | MIT
| Doc PR        |

Commits
-------

dd26c80 substitute aliases in inline mappings
675a3fe added ability for substitute aliases when mapping in YAML is on single line
@xabbuh xabbuh deleted the pr-11569 branch November 23, 2017 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0