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
callableThe callable method to execute
$args
arrayThe 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
stringThe string to validate
$err
stringThe 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
stringThe name of the validator method
$callback
callableThe callback to perform on validation
Properties