Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"required" not working with "dateFormat" #348

@2ik

Description

@2ik

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions