We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
requiredWith rule is not work right with rule chaining.
Check out the following example plz.
$data = [ 'name' => null, 'price' => null ]; $rules= [ 'requiredWith' => [ ['price', 'name'] ], 'integer' => ['price'] ]; $v = new \Valitron\Validator($data); $v->rules($rules); echo $v->validate() ? "passed\n" : "failed\n"; print_r($v->errors());
passed
Since name field value is null, price field is not required. so the validation should be passed.
name
price
failed Array ( [price] => Array ( [0] => Price must be an integer ) )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
requiredWith rule is not work right with rule chaining.
Check out the following example plz.
Example code
Expected result
Since
name
field value is null,price
field is not required. so the validation should be passed.Execution result
The text was updated successfully, but these errors were encountered: