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] Override the default option of the choice constraint#39002

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
ogizanagi merged 1 commit intosymfony:5.xfrombenji07:bug-choice-constraint
Nov 7, 2020

Conversation

@benji07
Copy link
Contributor

@benji07benji07 commentedNov 5, 2020
edited
Loading

QA
Branch?5.2
Bug fix?yes
New feature?no
Deprecations?no
TicketsN/A
LicenseMIT
Doc PRTODO

We have a bundle that run test against the last version of symfony and we detect BC Break when passing a string as the first argument of the class Choice

Our code extends the Choice class and change the defaultOption.

I saw that others constraints class had new construct signature (for php8 attributes), but only some of them kept the array options as their first arguments. Why ?

ping@ogizanagi@derrabus

https://travis-ci.com/github/Elao/PhpEnums/jobs/410045368

1) Elao\Enum\Tests\Unit\Bridge\Symfony\Validator\Constraint\EnumTest::testDefaultValueIsEnumClassSymfony\Component\Validator\Exception\MissingOptionsException: The options "class" must be set for constraint "Elao\Enum\Bridge\Symfony\Validator\Constraint\Enum"./home/travis/build/Elao/PhpEnums/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraint.php:171/home/travis/build/Elao/PhpEnums/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraint.php:110/home/travis/build/Elao/PhpEnums/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Choice.php:75/home/travis/build/Elao/PhpEnums/src/Bridge/Symfony/Validator/Constraint/Enum.php:39/home/travis/build/Elao/PhpEnums/tests/Unit/Bridge/Symfony/Validator/Constraint/EnumTest.php:22

derrabus reacted with eyes emoji
@benji07benji07 changed the title[Validator][Choice] Override the default option[Validator] Override the default option of the choice constraintNov 5, 2020
@ogizanagiogizanagi added this to the5.2 milestoneNov 5, 2020
Copy link
Contributor

@ogizanagiogizanagi left a comment

Choose a reason for hiding this comment

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

(AppVeyor failure is unrelated and fabbot doesn't like PHP 8 attributes yet)

@benji07
Copy link
ContributorAuthor

i just saw that we have a special key inside the $options arrayvalue, maybe i can use it instead of thegetDefaultOption() method (that's the way used in constraints like Count, DateTime, Isbn, ...)

@derrabus
Copy link
Member

i just saw that we have a special key inside the $options arrayvalue, maybe i can use it instead of thegetDefaultOption() method (that's the way used in constraints like Count, DateTime, Isbn, ...)

Yes,value should work as well.

@derrabus
Copy link
Member

Oh, for the two new files: Can you please add the usual file header (This file is part of the Symfony package. etc.) that you can find in other PHP files?

ogizanagi reacted with thumbs up emoji

…traintCo-authored-by: Maxime Steinhausser <maxime.steinhausser@gmail.com>
@ogizanagi
Copy link
Contributor

Thank you Benjamin.

@ogizanagiogizanagi merged commit50c7c3d intosymfony:5.xNov 7, 2020
@benji07benji07 deleted the bug-choice-constraint branchNovember 8, 2020 16:14
@fabpotfabpot mentioned this pull requestNov 10, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

6 participants

@benji07@derrabus@ogizanagi@chalasr@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp