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

[Validator] Reset constraint options#20122

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:2.7fromro0NL:validator/reset-options
Oct 2, 2016
Merged

[Validator] Reset constraint options#20122

fabpot merged 1 commit intosymfony:2.7fromro0NL:validator/reset-options
Oct 2, 2016

Conversation

@ro0NL
Copy link
Contributor

@ro0NLro0NL commentedOct 1, 2016
edited
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#20106
LicenseMIT
Doc PRreference to the documentation PR, if any

I think it's good to reset the internal pointer of the options array if we depend onkey($options). I've added tests to clarify we intentionally check for the first key.

The current behavior actually differs for hhvm/php7 -https://3v4l.org/e6r6E

linaori and surypavel reacted with thumbs up emoji
Copy link
Contributor

@lemoinemlemoinem left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. Looks good to me.

@fabpot
Copy link
Member

Have you check if this is the only place where we need that?

@lemoinem
Copy link
Contributor

lemoinem commentedOct 2, 2016
edited
Loading

@fabpot I grep'd through the Validator Component forkey() orcurrent().

The only other time they are used is in theYamlFileLoader. And I don't think it's possible for this array to have a misplaced internal pointer (single element array, generated by the Yaml Parser).

@fabpot
Copy link
Member

I was thinking about the other components and bundles as well.

@lemoinem
Copy link
Contributor

I'll take a look.

@lemoinem
Copy link
Contributor

@fabpot I double checked the rest of symfony's code. As far as I can tell, all other uses ofcurrent() andkey() are safe (most are on newly built arrays, the others are on arrays being iterated on).

@ro0NL
Copy link
ContributorAuthor

We should be careful though, it needs to be looked at on a per case basis.

I've double checked all subclasses, and overridden constructors are good to go.

@fabpot
Copy link
Member

Thank you@ro0NL.

@fabpotfabpot merged commit4c6ddd4 intosymfony:2.7Oct 2, 2016
fabpot added a commit that referenced this pull requestOct 2, 2016
This PR was merged into the 2.7 branch.Discussion----------[Validator] Reset constraint options| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#20106| License       | MIT| Doc PR        | reference to the documentation PR, if anyI think it's good to reset the internal pointer of the options array if we depend on `key($options)`. I've added tests to clarify we intentionally check for the first key.The current behavior actually differs for hhvm/php7 -https://3v4l.org/e6r6ECommits-------4c6ddd4 reset constraint options
@ro0NLro0NL deleted the validator/reset-options branchOctober 2, 2016 15:59
This was referencedOct 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@lemoinemlemoinemlemoinem approved these changes

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.

4 participants

@ro0NL@fabpot@lemoinem@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp