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

[Yaml] Add support for!php/enum *->value syntax#46771

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
fabpot merged 1 commit intosymfony:6.2fromnicolas-grekas:yaml-enum
Jun 25, 2022

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?6.2
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#44203 and the likes
LicenseMIT
Doc PR-

This PR allows one to use the following Yaml together with enums:

-!php/enumSomeEnum::Bar-!php/enumSomeEnum::Bar->value

The first line gets theSomeEnum::Bar instance. It's the same as writing!php/const SomeEnum::Bar but with an additional check that this is really an enum.

The second line is the one that is really needed as it allows referencing the value backed by an enum, which is something that is not possible currently.

ousmaneNdiaye reacted with thumbs up emojibernyho reacted with heart emoji
Copy link
Member

@stofstof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This misses the test ensuring that!php/enum cannot be parsed withoutYaml::PARSE_CONSTANT

@nicolas-grekas
Copy link
MemberAuthor

@stof PR updated, thanks for the review

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof requested changes

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

+1 more reviewer

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@fabpot@stof@ogizanagi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp