Efficient assertions to validate the input/output of your methods.
Methods | ||
---|---|---|
public
static
|
string(mixed $value, string $message = '')
|
# |
public
static
|
stringNotEmpty(mixed $value, string $message = '')
|
# |
public
static
|
integer(mixed $value, string $message = '')
|
# |
public
static
|
integerish(mixed $value, string $message = '')
|
# |
public
static
|
float(mixed $value, string $message = '')
|
# |
public
static
|
numeric(mixed $value, string $message = '')
|
# |
public
static
|
natural(mixed $value, string $message = '')
|
# |
public
static
|
boolean(mixed $value, string $message = '')
|
# |
public
static
|
scalar(mixed $value, string $message = '')
|
# |
public
static
|
object(mixed $value, string $message = '')
|
# |
public
static
|
resource(mixed $value, string|null $type = null, string $message = '')
|
# |
public
static
|
isCallable(mixed $value, string $message = '')
|
# |
public
static
|
isArray(mixed $value, string $message = '')
|
# |
public
static
|
isTraversable(mixed $value, string $message = '')
|
# |
public
static
|
isArrayAccessible(mixed $value, string $message = '')
|
# |
public
static
|
isCountable(mixed $value, string $message = '')
|
# |
public
static
|
isIterable(mixed $value, string $message = '')
|
# |
public
static
|
isInstanceOf<ExpectedType is object>(mixed $value, string|object $class, string $message = '')
|
# |
public
static
|
notInstanceOf<ExpectedType is object>(mixed $value, string|object $class, string $message = '')
|
# |
public
static
|
isInstanceOfAny(mixed $value, array<object|string> $classes, string $message = '')
|
# |
public
static
|
isAOf<ExpectedType is object>(object|string $value, string $class, string $message = '')
|
# |
public
static
|
isNotA<UnexpectedType is object>(object|string $value, string $class, string $message = '')
|
# |
public
static
|
isAnyOf(object|string $value, string[] $classes, string $message = '')
|
# |
public
static
|
isEmpty(mixed $value, string $message = '')
|
# |
public
static
|
notEmpty(mixed $value, string $message = '')
|
# |
public
static
|
null(mixed $value, string $message = '')
|
# |
public
static
|
notNull(mixed $value, string $message = '')
|
# |
public
static
|
true(mixed $value, string $message = '')
|
# |
public
static
|
false(mixed $value, string $message = '')
|
# |
public
static
|
notFalse(mixed $value, string $message = '')
|
# |
public
static
|
ip(mixed $value, string $message = '')
|
# |
public
static
|
ipv4(mixed $value, string $message = '')
|
# |
public
static
|
ipv6(mixed $value, string $message = '')
|
# |
public
static
|
email(mixed $value, string $message = '')
|
# |
public
static
|
uniqueValues(array $values, string $message = '')
|
# |
public
static
|
eq(mixed $value, mixed $expect, string $message = '')
|
# |
public
static
|
notEq(mixed $value, mixed $expect, string $message = '')
|
# |
public
static
|
same(mixed $value, mixed $expect, string $message = '')
|
# |
public
static
|
notSame(mixed $value, mixed $expect, string $message = '')
|
# |
public
static
|
greaterThan(mixed $value, mixed $limit, string $message = '')
|
# |
public
static
|
greaterThanEq(mixed $value, mixed $limit, string $message = '')
|
# |
public
static
|
lessThan(mixed $value, mixed $limit, string $message = '')
|
# |
public
static
|
lessThanEq(mixed $value, mixed $limit, string $message = '')
|
# |
public
static
|
range(mixed $value, mixed $min, mixed $max, string $message = '')
|
# |
public
static
|
oneOf(mixed $value, array $values, string $message = '')
|
# |
public
static
|
inArray(mixed $value, array $values, string $message = '')
|
# |
public
static
|
contains(string $value, string $subString, string $message = '')
|
# |
public
static
|
notContains(string $value, string $subString, string $message = '')
|
# |
public
static
|
notWhitespaceOnly(string $value, string $message = '')
|
# |
public
static
|
startsWith(string $value, string $prefix, string $message = '')
|
# |
public
static
|
notStartsWith(string $value, string $prefix, string $message = '')
|
# |
public
static
|
startsWithLetter(mixed $value, string $message = '')
|
# |
public
static
|
endsWith(string $value, string $suffix, string $message = '')
|
# |
public
static
|
notEndsWith(string $value, string $suffix, string $message = '')
|
# |
public
static
|
regex(string $value, string $pattern, string $message = '')
|
# |
public
static
|
notRegex(string $value, string $pattern, string $message = '')
|
# |
public
static
|
unicodeLetters(mixed $value, string $message = '')
|
# |
public
static
|
alpha(mixed $value, string $message = '')
|
# |
public
static
|
digits(string $value, string $message = '')
|
# |
public
static
|
alnum(string $value, string $message = '')
|
# |
public
static
|
lower(string $value, string $message = '')
|
# |
public
static
|
upper(string $value, string $message = '')
|
# |
public
static
|
length(string $value, int $length, string $message = '')
|
# |
public
static
|
minLength(string $value, int|float $min, string $message = '')
|
# |
public
static
|
maxLength(string $value, int|float $max, string $message = '')
|
# |
public
static
|
lengthBetween(string $value, int|float $min, int|float $max, string $message = '')
|
# |
public
static
|
fileExists(mixed $value, string $message = '')
|
# |
public
static
|
file(mixed $value, string $message = '')
|
# |
public
static
|
directory(mixed $value, string $message = '')
|
# |
public
static
|
readable(string $value, string $message = '')
|
# |
public
static
|
writable(string $value, string $message = '')
|
# |
public
static
|
classExists(mixed $value, string $message = '')
|
# |
public
static
|
subclassOf<ExpectedType is object>(mixed $value, string|object $class, string $message = '')
|
# |
public
static
|
interfaceExists(mixed $value, string $message = '')
|
# |
public
static
|
implementsInterface<ExpectedType is object>(mixed $value, mixed $interface, string $message = '')
|
# |
public
static
|
propertyExists(string|object $classOrObject, mixed $property, string $message = '')
|
# |
public
static
|
propertyNotExists(string|object $classOrObject, mixed $property, string $message = '')
|
# |
public
static
|
methodExists(string|object $classOrObject, mixed $method, string $message = '')
|
# |
public
static
|
methodNotExists(string|object $classOrObject, mixed $method, string $message = '')
|
# |
public
static
|
keyExists(array $array, string|int $key, string $message = '')
|
# |
public
static
|
keyNotExists(array $array, string|int $key, string $message = '')
|
# |
public
static
|
validArrayKey(mixed $value, string $message = '')
|
# |
public
static
|
count(Countable|array $array, int $number, string $message = '')
|
# |
public
static
|
minCount(Countable|array $array, int|float $min, string $message = '')
|
# |
public
static
|
maxCount(Countable|array $array, int|float $max, string $message = '')
|
# |
public
static
|
countBetween(Countable|array $array, int|float $min, int|float $max, string $message = '')
|
# |
public
static
|
isList(mixed $array, string $message = '')
|
# |
public
static
|
isNonEmptyList(mixed $array, string $message = '')
|
# |
public
static
|
isMap<T>(mixed $array, string $message = '')
|
# |
public
static
|
isNonEmptyMap<T>(mixed $array, string $message = '')
|
# |
public
static
|
uuid(string $value, string $message = '')
|
# |
public
static
|
throws(Closure $expression, string $class = 'Exception', string $message = '')
|
# |
public
static
|
__callStatic($name, $arguments)
|
# |
protected
static
|
valueToString(mixed $value): string
|
# |
protected
static
|
typeToString(mixed $value): string
|
# |
protected
static
|
strlen($value)
|
# |
protected
static
|
reportInvalidArgument(string $message)
|
# |