Methods
Magic "__call" method
__call(callable $method, array $args) : \Klein\Validator
Allows the ability to arbitrarily call a validator with an optional prefix
of "is" or "not" by simply calling an instance property like a callback
Parameters
$method
callable
The callable method to execute
$args
array
The argument array to pass to our callback
Exceptions
Returns
Sets up the validator chain with the string and optional error message
__construct(string $str, string $err)
Parameters
$str
string
The string to validate
$err
string
The optional custom exception message to throw on validation failure
Adds default validators on first use
addDefault() : void
Static
Add a custom validator to our list of validation methods
addValidator(string $method, callable $callback) : void
Static
Parameters
$method
string
The name of the validator method
$callback
callable
The callback to perform on validation
Properties