Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Validator] Avoid TypeError and improve DX when null groups#49137
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
base:7.4
Are you sure you want to change the base?
[Validator] Avoid TypeError and improve DX when null groups#49137
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There are probably more places inside the |
You're right , I updated PR |
@xabbuh Are you ok with the new version ? |
} | ||
return [$groups]; | ||
if (\in_array(null, $groups, true)) { | ||
throw new ValidatorException('Value in array of validation groups cannot be null.'); |
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.
Should be an InvalidArgumentException I suppose?
What about other types that are neither strings nor GroupSequence?
Also, since this is an improvement, it should target 6.3.
Uh oh!
There was an error while loading.Please reload this page.
Improve DX when we pass null value in array of groups
Before this PR
TypeError: Symfony\Component\Validator\Context\ExecutionContext::isGroupValidated(): Argument #2 ($groupHash) must be of type string, null given,