Class Callback
Check if the input is valid by specified callback
-
Wei\Base
-
Wei\Validator\BaseValidator
-
Wei\Validator\Callback
Methods summary
public
boolean
|
#
__invoke( mixed $input, Closure $fn = null, string|null $message = null )
Check if the input is valid by specified callback
Check if the input is valid by specified callback
Parameters
- $input
- The input value
- $fn
- The callback to validate the input
- $message
- The custom invalid message
Returns
boolean
Overrides
|
protected
boolean
|
#
doValidate( mixed $input )
Validate the input value (ignore the $negative property)
Validate the input value (ignore the $negative property)
Parameters
- $input
- The input to be validated
Returns
boolean
|
public
|
#
setMessage( string $message )
Set the invalid message
Parameters
Returns
$this
|
Methods inherited from Wei\Validator\BaseValidator
addError(),
getErrors(),
getFirstMessage(),
getJoinedMessage(),
getMessages(),
getName(),
hasError(),
isString(),
isValid(),
loadTranslationMessages(),
setMessages(),
setName(),
storeOption()
|
Properties summary
protected
string
|
$invalidMessage
|
|
protected
callable
|
$fn
The callback to validate the input
The callback to validate the input
|
|