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 76
static void
assert($value, $expected, $label = 'variable')
Throws exception if a variable is of unexpected type.
at line 102
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 120
static bool
is($value, $expected)
Finds whether a variable is of expected type.
at line 164
static bool
isNumericInt($value)
Finds whether a value is an integer.
at line 174
static bool
isNumeric($value)
Finds whether a string is a floating point number in decimal base.
at line 184
static bool
isCallable($value)
Finds whether a value is a syntactically correct callback.
at line 195
static bool
isUnicode($value)
Finds whether a value is an UTF-8 encoded string.
at line 205
static bool
isNone($value)
Finds whether a value is "falsy".
at line 216
static bool
isList($value)
Finds whether a variable is a zero-based integer indexed array.
at line 228
static bool
isInRange($value, $range)
Is a value in specified range?
at line 240
static bool
isEmail($value)
Finds whether a string is a valid email address.
at line 258
static bool
isUrl($value)
Finds whether a string is a valid http(s) URL.
at line 279
static bool
isUri($value)
Finds whether a string is a valid URI according to RFC 1738.
at line 290
static bool
isType($type)
Checks whether the input is a class, interface or trait.
at line 300
static bool
isPhpIdentifier($value)
Checks whether the input is a valid PHP identifier.