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] option to dump multi line strings as scalar blocks#17943
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 commentedFeb 27, 2016
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #16236,#16604,#17912,#17391 |
| License | MIT |
| Doc PR | symfony/symfony-docs#6226 |
| $prefix, | ||
| str_repeat('',$this->indentation), | ||
| $dumpedRow | ||
| ); |
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 should probably on one line.
fabpot commentedFeb 29, 2016
👍 |
| $isAHash =array_keys($input) !==range(0,count($input) -1); | ||
| foreach ($inputas$key =>$value) { | ||
| if ($inline -1 >0 && Yaml::DUMP_MULTI_LINE_AS_BLOCK &$flags &&is_string($value) &&false !==strpos($value,"\n")) { |
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.
I would say$inline > 1, to avoid an operation (even though OPCache might be able to detect this optimization)
7175f64 tob438a68Comparexabbuh commentedMar 1, 2016
I would like to rename the |
fabpot commentedMar 1, 2016
The rename sounds like a good idea to me. |
xabbuh commentedMar 1, 2016
I renamed the constant and added a changelog entry. This is ready for the final review. |
stof commentedMar 1, 2016
👍 We will need a doc PR for that though |
fabpot commentedMar 1, 2016
Thank you@xabbuh. |
…cks (xabbuh)This PR was merged into the 3.1-dev branch.Discussion----------[Yaml] option to dump multi line strings as scalar blocks| Q | A| ------------- | ---| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#16236,#16604,#17912,#17391| License | MIT| Doc PR | TODOCommits-------eff6902 option to dump multi line strings as scalar blocks
schorsch3000 commentedMar 1, 2016
Hi, i'm not sure if i'm doing something horrible wrong of if there is something buggy. Running this simple example throws the resulting string in $yaml is: foo and bar is not indented, why is that? Thanks, Dirk |
xabbuh commentedMar 1, 2016
@schorsch3000 Sorry for that and thank you for testing the new feature. :) Would you mind opening an issue for this? It looks indeed like a bug to me. |
schorsch3000 commentedMar 1, 2016
No problem, if my wishes get fullfilled im fine doing beta-testing :) |
xabbuh commentedMar 1, 2016
@schorsch3000 Oh wait, I just noticed that you passed |
schorsch3000 commentedMar 1, 2016
Damn, i've just reported that bug. without thinking about it. |
xabbuh commentedMar 1, 2016
@schorsch3000 I put some explanation in#17977 (comment). |
xabbuh commentedMar 1, 2016
@stof I have now added all new YAML features to the list insymfony/symfony-docs#6226. |
…abbuh)This PR was merged into the 2.3 branch.Discussion----------[Yaml] ensure dump indentation to be greather than zero| Q | A| ------------- | ---| Branch | 2.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#17943 (comment),#17977| License | MIT| Doc PR |Commits-------3464282 ensure dump indentation to be greather than zero