pdscopes / php-form-validator

Simple, extendable form validator for multi-dimensional forms
MIT License
12 stars 3 forks source link

Fixed required rules #10

Closed mintalicious closed 2 years ago

mintalicious commented 2 years ago

The former implementation of the Required rule validated '0' to be invalid. But as transferred query and post data always comes as strings, this would be unexpected behaviour. The rule now checks for null and empty strings, arrays and Countable instances. Integration test for Required rule has also been extended. Any other required-* rule has also been fixed.

pdscopes commented 2 years ago

This looks great, I'll have a proper look tomorrow. Thanks!

pdscopes commented 2 years ago

This is a lovely QOL update, I will release it as v2.9.0.

Thanks again for another great PR!