Validators
class Validators
Validation utilities.
Properties
static protected | $validators | ||
static protected | $counters |
Methods
Throws exception if a variable is of unexpected type (separated by pipe).
Throws exception if an array field is missing or of unexpected type (separated by pipe).
Finds whether a variable is of expected type (separated by pipe).
Finds whether all values are of expected type (separated by pipe).
Finds whether a value is an integer or a float.
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".
No description
Finds whether a variable is a zero-based integer indexed array.
Is a value in specified min and max value pair?
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 89
static void
assert($value, string $expected, string $label = 'variable')
Throws exception if a variable is of unexpected type (separated by pipe).
at line 108
static void
assertField(array $arr, $field, string $expected = null, string $label = "item '%' in array")
Throws exception if an array field is missing or of unexpected type (separated by pipe).
at line 122
static bool
is($value, string $expected)
Finds whether a variable is of expected type (separated by pipe).
at line 177
static bool
everyIs(iterable $values, string $expected)
Finds whether all values are of expected type (separated by pipe).
at line 191
static bool
isNumber($value)
Finds whether a value is an integer or a float.
at line 200
static bool
isNumericInt($value)
Finds whether a value is an integer.
at line 209
static bool
isNumeric($value)
Finds whether a string is a floating point number in decimal base.
at line 218
static bool
isCallable($value)
Finds whether a value is a syntactically correct callback.
at line 227
static bool
isUnicode($value)
Finds whether a value is an UTF-8 encoded string.
at line 236
static bool
isNone($value)
Finds whether a value is "falsy".
at line 243
static bool
isMixed()
internal |
No description
at line 252
static bool
isList($value)
Finds whether a variable is a zero-based integer indexed array.
at line 261
static bool
isInRange($value, array $range)
Is a value in specified min and max value pair?
at line 285
static bool
isEmail(string $value)
Finds whether a string is a valid email address.
at line 301
static bool
isUrl(string $value)
Finds whether a string is a valid http(s) URL.
at line 322
static bool
isUri(string $value)
Finds whether a string is a valid URI according to RFC 1738.
at line 331
static bool
isType(string $type)
Checks whether the input is a class, interface or trait.
at line 340
static bool
isPhpIdentifier(string $value)
Checks whether the input is a valid PHP identifier.
Traits
Static class.