vlucas/valitron

nested array validation passes when it shouldn't

program-the-brain-not-the-heartbeat opened this issue · 0 comments

Nested arrays pass validation when they should if the keys dont exist.

See example: threshold should have a min of 10, but they pass.


require('../vendor/autoload.php');

$v = new Valitron\Validator(array('settings' => array(
    // array('threshold' => 50),
    // array('threshold' => 90)
    'test' => 'test',
)));
$v->rule('min', 'settings.*.threshold', 10);
if($v->validate()) {
    echo "Yay! We're all good!";
} else {
    // Errors
    print_r($v->errors());
}

That spits out "Yay! We're all good!"