Class BaseValidator
BaseValidator, every validator MUST extend this class
Direct known subclasses
Phramework\Validate\AnyOf
,
Phramework\Validate\ArrayValidator
,
Phramework\Validate\BooleanValidator
,
Phramework\Validate\EnumValidator
,
Phramework\Validate\NumberValidator
,
Phramework\Validate\ObjectValidator
,
Phramework\Validate\StringValidator
Indirect known subclasses
Phramework\Validate\AllOf
,
Phramework\Validate\DatetimeValidator
,
Phramework\Validate\DateValidator
,
Phramework\Validate\EmailValidator
,
Phramework\Validate\IntegerValidator
,
Phramework\Validate\OneOf
,
Phramework\Validate\UnsignedIntegerValidator
,
Phramework\Validate\URLValidator
,
Phramework\Validate\UsernameValidator
Namespace: Phramework\Validate
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 0.0.0
Located at BaseValidator.php
Methods summary
public static
|
#
parseStatic( mixed $value )
This static method will instantiate a new object as validation model to parse the input value |
abstract public
|
|
protected
|
#
validateCommon( mixed $value,
Common helper method to validate against all common keywords |
protected
|
|
protected
|
#
validateEnum( mixed $value, mixed $parsedValue )
Common helper method to validate against "enum" keyword |
protected
|
#
validateNot( mixed $value, mixed $parsedValue )
Common helper method to validate against "not" keyword |
public static
string|null
|
|
public static
string[]
|
|
protected
|
|
public
mixed
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
#
parse( mixed $value )
This method use this validator to parse data from $value argument and return a clean object |
public static
|
|
protected static
|
#
createFromObjectForAdditional( object $object )
Helper method. Used to create anyOf, allOf and oneOf validators from objects |
public static
|
|
public static
|
|
public static
|
|
public
string
|
|
public
object
|
|
public
array
|
Properties summary
protected
callable|null
|
$validateCallback
|
#
null
|
protected static
string|null
|
$type
Validator's type Must be overwritten, default is 'string' |
#
null
|
protected static
string[]
|
$typeAttributes
Validator's attributes Can be overwritten |
#
[
]
|
protected static
string[]
|
$commonAttributes
Common validator attributes |
#
[
'title',
'description',
'default',
'format',
'enum',
'validateType', //non standard attribute, can be used in combination with enum
'not'
]
|
public
|
$default
|
|
protected
array
|
$attributes
Objects current attributes and values |
#
[]
|