-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
Description
What
In #116 @camcima presented a way to make array keys testable. With the given PR, array keys are converted into a value in the array, which then becomes testable the regular way. Thus, a key value "magically" appears in your data array.
We need to think if there is a better solution for this. For example if it would be possible to:
$v->required('products')->each(function (Validator $validator) {
$validator->key()->regex('/^SKU\d{4}\-\d{3}/');
$validator->required('price')->integer();
$validator->required('quantity')->integer;
});This issue is open to suggestions and pull requests.
Reactions are currently unavailable