-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] pass error code as a string #32244
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
xabbuh
commented
Jun 28, 2019
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | |
License | MIT |
Doc PR |
What's the goal of this change? |
@@ -528,7 +528,7 @@ public function testAddCustomizedViolation() | |||
$this->assertSame($entity, $violations[0]->getRoot()); | |||
$this->assertSame('Invalid value', $violations[0]->getInvalidValue()); | |||
$this->assertSame(2, $violations[0]->getPlural()); | |||
$this->assertSame(42, $violations[0]->getCode()); | |||
$this->assertSame('42', $violations[0]->getCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument is documented as string
in ConstraintViolationBuilderInterface::setCode()
. When adding type-hints in 5.0, we will need to compare the returned code with the string '42'
. Making the change in the test here makes it consistent across all branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref. #32066 (comment)
Thank you @xabbuh. |
This PR was merged into the 3.4 branch. Discussion ---------- [Validator] pass error code as a string | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 901fe0d pass error code as a string