Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh commentedNov 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])) { |
There was a problem hiding this comment.
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) andif($allowOverwrite) are interchangeable and thisif ... elseif is a bit confusing.
There was a problem hiding this comment.
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 betrue in a subsequent iteration where$key is different from<<.
There was a problem hiding this comment.
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 commentedNov 23, 2017
Thank you@xabbuh. |
…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 mappings675a3fe added ability for substitute aliases when mapping in YAML is on single line