Skip to content
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

exclude empty Arrays when validating items of non-scalar nature #19663

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

harusakura924
Copy link

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues #19657

I only initially modify known validators.

If there is anything missing, please add it, thank you.

@what-the-diff
Copy link

what-the-diff bot commented Nov 7, 2022

  • Added isEmpty method to DateValidator, EmailValidator, IpValidator, NumberValidator and String Validators.
  • The new methods are used in the clientOptions() of each validators respectively.

return call_user_func($this->isEmpty, $value);
}

return $value === null || $value === '';
Copy link
Contributor

Choose a reason for hiding this comment

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

NumberValidator has allowArray setting - I think we should accept empty array if it is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants