-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
YamlEncoder handle yml format #28815
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
fabpot
merged 1 commit into
symfony:master
from
mcsky:enhancement/serializer-handle-yml
Oct 11, 2018
Merged
YamlEncoder handle yml format #28815
fabpot
merged 1 commit into
symfony:master
from
mcsky:enhancement/serializer-handle-yml
Oct 11, 2018
+6
−2
Conversation
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
0bfb101
to
4271939
Compare
ro0NL
reviewed
Oct 11, 2018
|
4271939
to
261e5f8
Compare
Well, it's related to #28768 and was somehow validated by @nicolas-grekas |
fabpot
requested changes
Oct 11, 2018
261e5f8
to
491825b
Compare
491825b
to
d8640f9
Compare
fabpot
approved these changes
Oct 11, 2018
Thank you @mcsky. |
fabpot
added a commit
that referenced
this pull request
Oct 11, 2018
This PR was merged into the 4.2-dev branch. Discussion ---------- YamlEncoder handle yml format | Q | A | ------------- | --- | Branch? | ? | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28768 | License | MIT `Symfony\Component\Serializer\Encoder\YamlEncoder` now handle the `yml` format too ``` use Symfony\Component\Serializer\Serializer; use Symfony\Component\Serializer\Encoder\YamlEncoder; $serializer = new Serializer([], [new YamlEncoder()]); $content = file_get_contents(__DIR__ . '/test.yml'); $data = $serializer->decode($content, YamlEncoder::ALTERNATIVE_FORMAT); ``` Let me know if something is wrong for you Commits ------- d8640f9 YamlEncoder handle yml extension
fabpot
added a commit
that referenced
this pull request
Oct 12, 2018
…nt from 'YamlEncoder' (kevin-biig) This PR was merged into the 4.2-dev branch. Discussion ---------- 'yml' is not a format and shouldn't be visible as constant from 'YamlEncoder' A little fix of my [previous PR](#28815) This PR changes the constant visibility of the `yml` format as private. Because as @stof [mentionned](#28815 (comment)) `yml` isn't a format, so the constant shoudn't be public. Otherwise, this will be confusing while using autocomplete, you see two formats. The user can ask himself if there is a difference between `yaml` / `yml`. No need of that :) | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Fixed tickets | - | License | MIT | Doc PR | Commits ------- 674b359 'yml' is not a format and shouldn't be visible as constant from 'YamlEncoder' class
This was referenced Nov 3, 2018
Closed
Merged
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.
Symfony\Component\Serializer\Encoder\YamlEncoder
now handle theyml
format tooLet me know if something is wrong for you