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] fix PHP const mapping keys using the inline notation#35318

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:3.4fromxabbuh:issue-35179
Jan 13, 2020

Conversation

@xabbuh
Copy link
Member

QA
Branch?3.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#35179
LicenseMIT
Doc PR

@fabpot
Copy link
Member

Thank you@xabbuh.

fabpot added a commit that referenced this pull requestJan 13, 2020
…n (xabbuh)This PR was merged into the 3.4 branch.Discussion----------[Yaml] fix PHP const mapping keys using the inline notation| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#35179| License       | MIT| Doc PR        |Commits-------45461c7 fix PHP const mapping keys using the inline notation
@fabpotfabpot merged commit45461c7 intosymfony:3.4Jan 13, 2020
@xabbuhxabbuh deleted the issue-35179 branchJanuary 14, 2020 05:21
@rhift
Copy link

hey@xabbuh will this make its way into the YAML component? Sorry, I'm not familiar with the release process. Thanks for fixing it!

@xabbuh
Copy link
MemberAuthor

@rhift Yes, this change will be part of the next patch releases for 3.4, 4.3, 4.4 and 5.0 as well as future minor versions.

rhift reacted with hooray emoji

$isKeyQuoted =\in_array($mapping[$i], ['"',"'"],true);
$key =self::parseScalar($mapping,$flags, [':',''],$i,false, [],true);

if ('!php/const' ===$key) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we check forself::$constantSupport first? /cc@xabbuh

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think this is fine becauseevaluateScalar() (which is called now) does the check.

This was referencedJan 21, 2020
@rhift
Copy link

Hi there, thanks for this!

I can get globally defined constants to work great, but I can't find a way to get class constants to work. Is this intended behavior?

I've tried the following.

!php/const \PATH\TO\Class::CONSTANT: "value"!php/const "\PATH\TO\Class::CONSTANT": "value"

The scope resolution operator (::) is trimmed and the constant cannot be found.

Being able to use class constants as keys was what I was hoping for when submitting#35179.

Any help would be appreciated. Thank you. =)

@xabbuh
Copy link
MemberAuthor

@rhift If I don't miss anything, we have these cases covered with tests. Could you open a new issue please with some code that allows to reproduce so that we can see whether there is another bug or if there is something else going wrong?

@rhift
Copy link

@xabbuh ok, thanks! I opened#36624.

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

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@xabbuh@fabpot@rhift@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp