Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@mcsky
Copy link

@mcskymcsky commentedOct 11, 2018
edited
Loading

QA
Branch??
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#28768
LicenseMIT

Symfony\Component\Serializer\Encoder\YamlEncoder now handle theyml 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

Nek- reacted with thumbs up emojijvasseur and onEXHovia reacted with thumbs down emoji
@stof
Copy link
Member

yml is not a format. It is an alternativeextension for the YAML format. I would find it bad to see some constants calling it a format.

jvasseur and mcsky reacted with thumbs up emoji

@mcskymcskyforce-pushed theenhancement/serializer-handle-yml branch from4271939 to261e5f8CompareOctober 11, 2018 12:58
@Nek-
Copy link
Contributor

Well, it's related to#28768 and was somehow validated by@nicolas-grekas

@mcskymcskyforce-pushed theenhancement/serializer-handle-yml branch from491825b tod8640f9CompareOctober 11, 2018 13:09
@fabpot
Copy link
Member

Thank you@mcsky.

@fabpotfabpot merged commitd8640f9 intosymfony:masterOct 11, 2018
fabpot added a commit that referenced this pull requestOct 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 youCommits-------d8640f9 YamlEncoder handle yml extension
fabpot added a commit that referenced this pull requestOct 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 referencedNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@dunglasdunglasAwaiting requested review from dunglas

+1 more reviewer

@ro0NLro0NLro0NL left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@mcsky@stof@Nek-@fabpot@ro0NL@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp