Validators
class Validators extends Object
Validation utilities.
Properties
static protected | $validators | ||
static protected | $counters |
Methods
Throws exception if a variable is of unexpected type.
Throws exception if an array field is missing or of unexpected type.
Finds whether a variable is of expected type.
Finds whether a value is an integer.
Finds whether a string is a floating point number in decimal base.
Finds whether a value is a syntactically correct callback.
Finds whether a value is an UTF-8 encoded string.
Finds whether a value is "falsy".
Finds whether a variable is a zero-based integer indexed array.
Is a value in specified range?
Finds whether a string is a valid email address.
Finds whether a string is a valid http(s) URL.
Finds whether a string is a valid URI according to RFC 1738.
Checks whether the input is a class, interface or trait.
Checks whether the input is a valid PHP identifier.
Details
at line 74
static void
assert($value, $expected, $label = 'variable')
Throws exception if a variable is of unexpected type.
at line 100
static void
assertField($arr, $field, $expected = NULL, $label = "item '%' in array")
Throws exception if an array field is missing or of unexpected type.
at line 118
static bool
is($value, $expected)
Finds whether a variable is of expected type.
at line 162
static bool
isNumericInt($value)
Finds whether a value is an integer.
at line 172
static bool
isNumeric($value)
Finds whether a string is a floating point number in decimal base.
at line 182
static bool
isCallable($value)
Finds whether a value is a syntactically correct callback.
at line 193
static bool
isUnicode($value)
Finds whether a value is an UTF-8 encoded string.
at line 203
static bool
isNone($value)
Finds whether a value is "falsy".
at line 214
static bool
isList($value)
Finds whether a variable is a zero-based integer indexed array.
at line 226
static bool
isInRange($value, $range)
Is a value in specified range?
at line 238
static bool
isEmail($value)
Finds whether a string is a valid email address.
at line 256
static bool
isUrl($value)
Finds whether a string is a valid http(s) URL.
at line 277
static bool
isUri($value)
Finds whether a string is a valid URI according to RFC 1738.
at line 288
static bool
isType($type)
Checks whether the input is a class, interface or trait.
at line 298
static bool
isPhpIdentifier($value)
Checks whether the input is a valid PHP identifier.