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

"required" not working with "dateFormat" #348

Open
2ik opened this issue Oct 27, 2021 · 0 comments
Open

"required" not working with "dateFormat" #348

2ik opened this issue Oct 27, 2021 · 0 comments

Comments

@2ik
Copy link

2ik commented Oct 27, 2021

accidentally discovered such a problem

php8.1

example:

$validator = new Validator([]);
$validator->mapFieldsRules([
    'dateFrom' => ['required', ['dateFormat', 'Y-m-d']],
]);
$validator->validate();

output error:

ERROR: date_parse_from_format(): Passing null to parameter #2 ($datetime) of type string is deprecated on line 764 in file path/vlucas/valitron/src/Valitron/Validator.php.

I also wanted to know, how about not checking other rules if the required field is missing?

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

No branches or pull requests

1 participant