valitron icon indicating copy to clipboard operation
valitron copied to clipboard

Valitron is a simple, elegant, stand-alone validation library with NO dependencies

Results 58 valitron issues
Sort by recently updated
recently updated
newest added

fields with DOT (.) not working $validationBody->rule('requiredWithout', 'card.id', ['card.name', 'card.expiryMonth', 'card.expiryYear', 'card.number']); $validationBody->rule('requiredWithout', 'card.number', ['card.id'])->rule('numeric', 'card.number'); $validationBody->rule('requiredWithout', 'card.name', ['card.id'])->rule('alphaNumSpace', 'card.name');

bug

accidentally discovered such a problem **php8.1** example: ```php $validator = new Validator([]); $validator->mapFieldsRules([ 'dateFrom' => ['required', ['dateFormat', 'Y-m-d']], ]); $validator->validate(); ``` output error: ``` ERROR: date_parse_from_format(): Passing null to parameter...

I have two custom validation rules: ` Validator::addRule('requiredIfUK', function($field, $value, array $params, array $fields) { $this->log->info('post code rule'); if ($value == '' && $fields['country'] == 'United Kingdom') { return false;...

Hi! I'm getting this error in vlucas\valitron\src\Valitron\Validator.php line 366 On Windows. I think it's an issue with php version 7.4.18 (win), because on php 7.3.29 (linux) it doesn't happen.

bug

I just ran into this issue in another project while evaluating PHP 8 support. https://php.watch/versions/8.0/named-parameters#named-params-call_user_func_array PHP 8 supports named parameters and call_user_func_array uses that when the parameter array has keys....

Hello! Having a little issue when adding a custom rule. Line 1127 of Validator.php does this: `'message' => '{field} ' . $message` This means when I add a custom rule...

enhancement

Field country_province_id should only be required when field country_id is present in the input data and country_id value is 23. Custom rule "requiredIfOther" does not work because you will have...

Sometimes it is useful to have not only the error message, but also the name of the rule that was violated. The name of the rule can be used as...

I have a project that need validate only integer type. i want to contribute one function to this repo instead of build my own validation. thank you