Class NValidators
Validation utilities.
- NObject
- NValidators
public static
|
|
public static
|
#
assertField( array $arr, string $field, string $expected = NULL, string $label = "item '%' in array" )
Throws exception if an array field is missing or of unexpected type. |
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
__call(),
__callStatic(),
__get(),
__isset(),
__set(),
__unset(),
extensionMethod(),
getReflection()
|
protected static
array
|
$validators | array(
'bool' => 'is_bool',
'boolean' => 'is_bool',
'int' => 'is_int',
'integer' => 'is_int',
'float' => 'is_float',
'number' => NULL, // is_int || is_float,
'numeric' => array(__CLASS__, 'isNumeric'),
'numericint' => array(__CLASS__, 'isNumericInt'),
'string' => 'is_string',
'unicode' => array(__CLASS__, 'isUnicode'),
'array' => 'is_array',
'list' => array(__CLASS__, 'isList'),
'object' => 'is_object',
'resource' => 'is_resource',
'scalar' => 'is_scalar',
'callable' => array(__CLASS__, 'isCallable'),
'null' => 'is_null',
'email' => array(__CLASS__, 'isEmail'),
'url' => array(__CLASS__, 'isUrl'),
'none' => array(__CLASS__, 'isNone'),
'pattern' => NULL,
'alnum' => 'ctype_alnum',
'alpha' => 'ctype_alpha',
'digit' => 'ctype_digit',
'lower' => 'ctype_lower',
'upper' => 'ctype_upper',
'space' => 'ctype_space',
'xdigit' => 'ctype_xdigit',
) |
|
protected static
array
|
$counters | array(
'string' => 'strlen',
'unicode' => array('NStrings', 'length'),
'array' => 'count',
'list' => 'count',
'alnum' => 'strlen',
'alpha' => 'strlen',
'digit' => 'strlen',
'lower' => 'strlen',
'space' => 'strlen',
'upper' => 'strlen',
'xdigit' => 'strlen',
) |
$reflection
|