Class Type
Check if the type of input is equals specified type name
-
Wei\Base
-
Wei\Validator\BaseValidator
-
Wei\Validator\Type
Methods summary
public
boolean
|
#
__invoke( string $input, $type = null )
Validate the input value
Parameters
- $input
- $type The expected type of $input
- $type
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
array
|
#
getMessages( string $name = null )
Returns the error messages
Returns the error messages
Parameters
- $name
- The name display in error message
Returns
array
Throws
UnexpectedValueException When message contains unknown parameter
Overrides
|
Methods inherited from Wei\Validator\BaseValidator
addError(),
getErrors(),
getFirstMessage(),
getJoinedMessage(),
getName(),
hasError(),
isString(),
isValid(),
loadTranslationMessages(),
setMessages(),
setName(),
storeOption()
|
Properties summary
protected
string
|
$typeMessage
|
#
'%name% must be %typeName%'
|
protected
string
|
$negativeMessage
The common message for negative validator
The common message for negative validator
|
#
'%name% must not be %typeName%'
|
protected
string
|
$type
The expected type of input
The expected type of input
|
|
protected
string
|
$typeName
The translated type name for display
The translated type name for display
|
|