You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added addType() which allows custom types to be defined.
Types can now extend other types, allowing for more complex rule configuration.
Changed closure/callable validator signature from ($name, $value, $validator) to ($value, $rule, $validator) to match built-in validator signatures better. The name of the field is available through $rule['name'].
Dropped closure validator type (e.g. isClosure()).
Rules may now be a closure/callable or you can pass a validator key equal to a closure/callable along with your rule array. See issue #4 for more information.
required is set to true by default for rules where required is not set. You may override this value per rule by setting required equal to false.
<?phpuse \Noname\Common\Validator;
// You can validate a type in one of the following ways
Validate::is('string', 'Hello world!');
Validate::isString('Hello world!');