Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh commentedJun 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 |
nicolas-grekas commentedJun 28, 2019
What's the goal of this change? |
| $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 asstring inConstraintViolationBuilderInterface::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)
nicolas-grekas commentedJun 28, 2019
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