[Yaml] add option to dump objects as maps#17728
Merged
Merged
Conversation
Member
xabbuh
commented
Feb 8, 2016
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #9870, #12860, #15781, #15937, #16266 |
| License | MIT |
| Doc PR | symfony/symfony-docs#6226 |
Member
Author
|
I am not convinced that we should do this for all objects. Maybe it would be better to only support this option for |
This was referenced Feb 8, 2016
Closed
Member
|
I agree that it should not be done for any object. It makes sense for stdClass, ArrayObject, and maybe other Traversable objects. DateTime and DateTimeImmutable should be better dumped as a Yaml timestamp (with a parser flag to parse timestamps as a DateTime rather than as an integer too btw) |
| case is_object($value): | ||
| if (Yaml::DUMP_OBJECT & $flags) { | ||
| return '!php/object:'.serialize($value); | ||
| } elseif (Yaml::DUMP_OBJECT_AS_MAP & $flags) { |
393d06d to
80f0b66
Compare
Member
Author
|
I updated here to have the mapping only work with |
Member
Author
|
see #17836 for the |
Member
|
This one needs to be rebased |
Member
Author
|
rebased, failures are unrelated |
Member
|
Thank you @xabbuh. |
fabpot
added a commit
that referenced
this pull request
Feb 28, 2016
This PR was merged into the 3.1-dev branch. Discussion ---------- [Yaml] add option to dump objects as maps | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #9870, #12860, #15781, #15937, #16266 | License | MIT | Doc PR | TODO Commits ------- 3941d2e [Yaml] add option to dump objects as maps
7 tasks
Merged
nicolas-grekas
added a commit
that referenced
this pull request
Apr 12, 2017
…bbuh) This PR was merged into the 3.2 branch. Discussion ---------- [Yaml] add changelog for the DUMP_OBJECT_AS_MAP flag | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17728 | License | MIT | Doc PR | Adds missing changelog entry for the `DUMP_OBJECT_AS_MAP` flag introduced in #17728. Commits ------- 8fd3602 add changelog for the DUMP_OBJECT_AS_MAP flag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.