-
Notifications
You must be signed in to change notification settings - Fork 341
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
Validation for empty array fields doesn't seem to work #315
Comments
no, they should NOT be valid imho |
but maybe coz they are empty? here you cast to light an important "feature" , //thinking about empty forms// it shows i guess it's the programmer's responsability to chek for empty data PRIOR validation, humm... there must be some default settings regarding empty data sets ; i'm going to investigate the unit tests right now. Hang on |
can't find. they are 43 Validators in https://github.com/Wixel/GUMP/tree/master/tests/Validators but none for empty array() |
in those 43 files they are a total of 38 calls to function testWhenInputIsEmptyAndNotRequiredIsSuccess() but can't find empty array() tests |
P.S. @ocean90 for your issue to be seen i'd suggest you rename its title to e.g. Empty [] arrays NOT ... or EMPTY ARRAYS .... smth |
Fixed now. Way to use it: $is_valid = GUMP::is_valid(
$data,
[
'array_data_required' => 'required|valid_array_size_equal,1'
]
); |
Example:
In the above example I'd expect that the result is not valid for both fields since their value is empty. Am I'm missing something here?
The text was updated successfully, but these errors were encountered: