Documentation

Assert
in package
Uses Mixin

Efficient assertions to validate the input/output of your methods.

Tags
since
1.0
author

Bernhard Schussek bschussek@gmail.com

Table of Contents

Methods

__callStatic()  : mixed
allAlnum()  : void
allAlpha()  : void
allBoolean()  : void
allClassExists()  : void
allContains()  : void
allCount()  : void
allCountBetween()  : void
allDigits()  : void
allDirectory()  : void
allEmail()  : void
allEndsWith()  : void
allEq()  : void
allFalse()  : void
allFile()  : void
allFileExists()  : void
allFloat()  : void
allGreaterThan()  : void
allGreaterThanEq()  : void
allImplementsInterface()  : void
allInArray()  : void
allInteger()  : void
allIntegerish()  : void
allInterfaceExists()  : void
allIp()  : void
allIpv4()  : void
allIpv6()  : void
allIsAnyOf()  : void
allIsAOf()  : void
allIsArray()  : void
allIsArrayAccessible()  : void
allIsCallable()  : void
allIsCountable()  : void
allIsEmpty()  : void
allIsInstanceOf()  : void
allIsInstanceOfAny()  : void
allIsIterable()  : void
allIsList()  : void
allIsMap()  : void
allIsNonEmptyList()  : void
allIsNonEmptyMap()  : void
allIsNotA()  : void
allIsTraversable()  : void
allKeyExists()  : void
allKeyNotExists()  : void
allLength()  : void
allLengthBetween()  : void
allLessThan()  : void
allLessThanEq()  : void
allLower()  : void
allMaxCount()  : void
allMaxLength()  : void
allMethodExists()  : void
allMethodNotExists()  : void
allMinCount()  : void
allMinLength()  : void
allNatural()  : void
allNotContains()  : void
allNotEmpty()  : void
allNotEndsWith()  : void
allNotEq()  : void
allNotFalse()  : void
allNotInstanceOf()  : void
allNotNull()  : void
allNotRegex()  : void
allNotSame()  : void
allNotStartsWith()  : void
allNotWhitespaceOnly()  : void
allNull()  : void
allNullOrAlnum()  : void
allNullOrAlpha()  : void
allNullOrBoolean()  : void
allNullOrClassExists()  : void
allNullOrContains()  : void
allNullOrCount()  : void
allNullOrCountBetween()  : void
allNullOrDigits()  : void
allNullOrDirectory()  : void
allNullOrEmail()  : void
allNullOrEndsWith()  : void
allNullOrEq()  : void
allNullOrFalse()  : void
allNullOrFile()  : void
allNullOrFileExists()  : void
allNullOrFloat()  : void
allNullOrGreaterThan()  : void
allNullOrGreaterThanEq()  : void
allNullOrImplementsInterface()  : void
allNullOrInArray()  : void
allNullOrInteger()  : void
allNullOrIntegerish()  : void
allNullOrInterfaceExists()  : void
allNullOrIp()  : void
allNullOrIpv4()  : void
allNullOrIpv6()  : void
allNullOrIsAnyOf()  : void
allNullOrIsAOf()  : void
allNullOrIsArray()  : void
allNullOrIsArrayAccessible()  : void
allNullOrIsCallable()  : void
allNullOrIsCountable()  : void
allNullOrIsEmpty()  : void
allNullOrIsInstanceOf()  : void
allNullOrIsInstanceOfAny()  : void
allNullOrIsIterable()  : void
allNullOrIsList()  : void
allNullOrIsMap()  : void
allNullOrIsNonEmptyList()  : void
allNullOrIsNonEmptyMap()  : void
allNullOrIsNotA()  : void
allNullOrIsTraversable()  : void
allNullOrKeyExists()  : void
allNullOrKeyNotExists()  : void
allNullOrLength()  : void
allNullOrLengthBetween()  : void
allNullOrLessThan()  : void
allNullOrLessThanEq()  : void
allNullOrLower()  : void
allNullOrMaxCount()  : void
allNullOrMaxLength()  : void
allNullOrMethodExists()  : void
allNullOrMethodNotExists()  : void
allNullOrMinCount()  : void
allNullOrMinLength()  : void
allNullOrNatural()  : void
allNullOrNotContains()  : void
allNullOrNotEmpty()  : void
allNullOrNotEndsWith()  : void
allNullOrNotEq()  : void
allNullOrNotFalse()  : void
allNullOrNotInstanceOf()  : void
allNullOrNotRegex()  : void
allNullOrNotSame()  : void
allNullOrNotStartsWith()  : void
allNullOrNotWhitespaceOnly()  : void
allNullOrNumeric()  : void
allNullOrObject()  : void
allNullOrOneOf()  : void
allNullOrPositiveInteger()  : void
allNullOrPropertyExists()  : void
allNullOrPropertyNotExists()  : void
allNullOrRange()  : void
allNullOrReadable()  : void
allNullOrRegex()  : void
allNullOrResource()  : void
allNullOrSame()  : void
allNullOrScalar()  : void
allNullOrStartsWith()  : void
allNullOrStartsWithLetter()  : void
allNullOrString()  : void
allNullOrStringNotEmpty()  : void
allNullOrSubclassOf()  : void
allNullOrThrows()  : void
allNullOrTrue()  : void
allNullOrUnicodeLetters()  : void
allNullOrUniqueValues()  : void
allNullOrUpper()  : void
allNullOrUuid()  : void
allNullOrValidArrayKey()  : void
allNullOrWritable()  : void
allNumeric()  : void
allObject()  : void
allOneOf()  : void
allPositiveInteger()  : void
allPropertyExists()  : void
allPropertyNotExists()  : void
allRange()  : void
allReadable()  : void
allRegex()  : void
allResource()  : void
allSame()  : void
allScalar()  : void
allStartsWith()  : void
allStartsWithLetter()  : void
allString()  : void
allStringNotEmpty()  : void
allSubclassOf()  : void
allThrows()  : void
allTrue()  : void
allUnicodeLetters()  : void
allUniqueValues()  : void
allUpper()  : void
allUuid()  : void
allValidArrayKey()  : void
allWritable()  : void
alnum()  : mixed
alpha()  : mixed
boolean()  : mixed
classExists()  : mixed
contains()  : mixed
count()  : mixed
Does not check if $array is countable, this can generate a warning on php versions after 7.2.
countBetween()  : mixed
Does not check if $array is countable, this can generate a warning on php versions after 7.2.
digits()  : mixed
directory()  : mixed
email()  : mixed
endsWith()  : mixed
eq()  : mixed
false()  : mixed
file()  : mixed
fileExists()  : mixed
Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file.
float()  : mixed
greaterThan()  : mixed
greaterThanEq()  : mixed
implementsInterface()  : mixed
inArray()  : mixed
Does strict comparison, so Assert::inArray(3, ['3']) does not pass the assertion.
integer()  : mixed
integerish()  : mixed
interfaceExists()  : mixed
ip()  : mixed
ipv4()  : mixed
ipv6()  : mixed
isAnyOf()  : mixed
isAOf()  : mixed
isArray()  : mixed
isArrayAccessible()  : mixed
isCallable()  : mixed
isCountable()  : mixed
isEmpty()  : mixed
isInstanceOf()  : mixed
isInstanceOfAny()  : mixed
isIterable()  : mixed
isList()  : mixed
isMap()  : mixed
isNonEmptyList()  : mixed
isNonEmptyMap()  : mixed
isNotA()  : mixed
isTraversable()  : mixed
keyExists()  : mixed
keyNotExists()  : mixed
length()  : mixed
lengthBetween()  : mixed
Inclusive , so Assert::lengthBetween('asd', 3, 5); passes the assertion.
lessThan()  : mixed
lessThanEq()  : mixed
lower()  : mixed
maxCount()  : mixed
Does not check if $array is countable, this can generate a warning on php versions after 7.2.
maxLength()  : mixed
Inclusive max.
methodExists()  : mixed
methodNotExists()  : mixed
minCount()  : mixed
Does not check if $array is countable, this can generate a warning on php versions after 7.2.
minLength()  : mixed
Inclusive min.
natural()  : mixed
notContains()  : mixed
notEmpty()  : mixed
notEndsWith()  : mixed
notEq()  : mixed
notFalse()  : mixed
notInstanceOf()  : mixed
notNull()  : mixed
notRegex()  : mixed
notSame()  : mixed
notStartsWith()  : mixed
notWhitespaceOnly()  : mixed
null()  : mixed
nullOrAlnum()  : void
nullOrAlpha()  : void
nullOrBoolean()  : void
nullOrClassExists()  : void
nullOrContains()  : void
nullOrCount()  : void
nullOrCountBetween()  : void
nullOrDigits()  : void
nullOrDirectory()  : void
nullOrEmail()  : void
nullOrEndsWith()  : void
nullOrEq()  : void
nullOrFalse()  : void
nullOrFile()  : void
nullOrFileExists()  : void
nullOrFloat()  : void
nullOrGreaterThan()  : void
nullOrGreaterThanEq()  : void
nullOrImplementsInterface()  : void
nullOrInArray()  : void
nullOrInteger()  : void
nullOrIntegerish()  : void
nullOrInterfaceExists()  : void
nullOrIp()  : void
nullOrIpv4()  : void
nullOrIpv6()  : void
nullOrIsAnyOf()  : void
nullOrIsAOf()  : void
nullOrIsArray()  : void
nullOrIsArrayAccessible()  : void
nullOrIsCallable()  : void
nullOrIsCountable()  : void
nullOrIsEmpty()  : void
nullOrIsInstanceOf()  : void
nullOrIsInstanceOfAny()  : void
nullOrIsIterable()  : void
nullOrIsList()  : void
nullOrIsMap()  : void
nullOrIsNonEmptyList()  : void
nullOrIsNonEmptyMap()  : void
nullOrIsNotA()  : void
nullOrIsTraversable()  : void
nullOrKeyExists()  : void
nullOrKeyNotExists()  : void
nullOrLength()  : void
nullOrLengthBetween()  : void
nullOrLessThan()  : void
nullOrLessThanEq()  : void
nullOrLower()  : void
nullOrMaxCount()  : void
nullOrMaxLength()  : void
nullOrMethodExists()  : void
nullOrMethodNotExists()  : void
nullOrMinCount()  : void
nullOrMinLength()  : void
nullOrNatural()  : void
nullOrNotContains()  : void
nullOrNotEmpty()  : void
nullOrNotEndsWith()  : void
nullOrNotEq()  : void
nullOrNotFalse()  : void
nullOrNotInstanceOf()  : void
nullOrNotRegex()  : void
nullOrNotSame()  : void
nullOrNotStartsWith()  : void
nullOrNotWhitespaceOnly()  : void
nullOrNumeric()  : void
nullOrObject()  : void
nullOrOneOf()  : void
nullOrPositiveInteger()  : void
nullOrPropertyExists()  : void
nullOrPropertyNotExists()  : void
nullOrRange()  : void
nullOrReadable()  : void
nullOrRegex()  : void
nullOrResource()  : void
nullOrSame()  : void
nullOrScalar()  : void
nullOrStartsWith()  : void
nullOrStartsWithLetter()  : void
nullOrString()  : void
nullOrStringNotEmpty()  : void
nullOrSubclassOf()  : void
nullOrThrows()  : void
nullOrTrue()  : void
nullOrUnicodeLetters()  : void
nullOrUniqueValues()  : void
nullOrUpper()  : void
nullOrUuid()  : void
nullOrValidArrayKey()  : void
nullOrWritable()  : void
numeric()  : mixed
object()  : mixed
oneOf()  : mixed
A more human-readable alias of Assert::inArray().
positiveInteger()  : mixed
propertyExists()  : mixed
propertyNotExists()  : mixed
range()  : mixed
Inclusive range, so Assert::(3, 3, 5) passes.
readable()  : mixed
regex()  : mixed
resource()  : mixed
same()  : mixed
scalar()  : mixed
startsWith()  : mixed
startsWithLetter()  : mixed
string()  : mixed
stringNotEmpty()  : mixed
subclassOf()  : mixed
throws()  : mixed
true()  : mixed
unicodeLetters()  : mixed
uniqueValues()  : mixed
Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.
upper()  : mixed
uuid()  : mixed
validArrayKey()  : mixed
Checks if a value is a valid array key (int or string).
writable()  : mixed
reportInvalidArgument()  : mixed
strlen()  : mixed
typeToString()  : string
valueToString()  : string
__construct()  : mixed

Methods

__callStatic()

public static __callStatic(mixed $name, mixed $arguments) : mixed
Parameters
$name : mixed
$arguments : mixed
Tags
throws
BadMethodCallException

allAlnum()

public static allAlnum(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allAlpha()

public static allAlpha(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allBoolean()

public static allBoolean(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allClassExists()

public static allClassExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

iterable $value

throws
InvalidArgumentException

allContains()

public static allContains(iterable<string|int, string> $value, string $subString[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allCount()

public static allCount(iterable<string|int, Countable|array<string|int, mixed>> $array, int $number[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>>
$number : int
$message : string = ''
Tags
throws
InvalidArgumentException

allCountBetween()

public static allCountBetween(iterable<string|int, Countable|array<string|int, mixed>> $array, int|float $min, int|float $max[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>>
$min : int|float
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

allDigits()

public static allDigits(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allDirectory()

public static allDirectory(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allEmail()

public static allEmail(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allEndsWith()

public static allEndsWith(iterable<string|int, string> $value, string $suffix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allEq()

public static allEq(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allFalse()

public static allFalse(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allFile()

public static allFile(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allFileExists()

public static allFileExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allFloat()

public static allFloat(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allGreaterThan()

public static allGreaterThan(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allGreaterThanEq()

public static allGreaterThanEq(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allImplementsInterface()

public static allImplementsInterface(mixed $value, mixed $interface[, string $message = '' ]) : void
Parameters
$value : mixed
$interface : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $interface

psalm-assert

iterable<class-string<ExpectedType>> $value

throws
InvalidArgumentException

allInArray()

public static allInArray(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : void
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allInteger()

public static allInteger(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allIntegerish()

public static allIntegerish(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allInterfaceExists()

public static allInterfaceExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

iterable $value

throws
InvalidArgumentException

allIp()

public static allIp(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allIpv4()

public static allIpv4(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allIpv6()

public static allIpv6(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allIsAnyOf()

public static allIsAnyOf(iterable<string|int, object|string> $value, array<string|int, string> $classes[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, object|string>
$classes : array<string|int, string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

allIsAOf()

public static allIsAOf(iterable<string|int, object|string> $value, string $class[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, object|string>
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

iterable<ExpectedType|class-string<ExpectedType>> $value

throws
InvalidArgumentException

allIsArray()

public static allIsArray(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allIsArrayAccessible()

public static allIsArrayAccessible(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<array|ArrayAccess> $value

throws
InvalidArgumentException

allIsCallable()

public static allIsCallable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allIsCountable()

public static allIsCountable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allIsEmpty()

public static allIsEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allIsInstanceOf()

public static allIsInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

iterable<ExpectedType> $value

throws
InvalidArgumentException

allIsInstanceOfAny()

public static allIsInstanceOfAny(mixed $value, array<string|int, object|string> $classes[, string $message = '' ]) : void
Parameters
$value : mixed
$classes : array<string|int, object|string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

allIsIterable()

public static allIsIterable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allIsList()

public static allIsList(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $array

throws
InvalidArgumentException

allIsMap()

public static allIsMap(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

iterable<mixed|array<T>> $array

psalm-assert

iterable<array<string, T>> $array

throws
InvalidArgumentException

allIsNonEmptyList()

public static allIsNonEmptyList(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $array

throws
InvalidArgumentException

allIsNonEmptyMap()

public static allIsNonEmptyMap(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

iterable<mixed|array<T>> $array

throws
InvalidArgumentException

allIsNotA()

public static allIsNotA(iterable<string|int, object|string> $value, string $class[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, object|string>
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

UnexpectedType of object

psalm-param

class-string<UnexpectedType> $class

throws
InvalidArgumentException

allIsTraversable()

public static allIsTraversable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

deprecated

use "isIterable" or "isInstanceOf" instead

throws
InvalidArgumentException

allKeyExists()

public static allKeyExists(iterable<string|int, array<string|int, mixed>> $array, string|int $key[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, array<string|int, mixed>>
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allKeyNotExists()

public static allKeyNotExists(iterable<string|int, array<string|int, mixed>> $array, string|int $key[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, array<string|int, mixed>>
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allLength()

public static allLength(iterable<string|int, string> $value, int $length[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$length : int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allLengthBetween()

public static allLengthBetween(iterable<string|int, string> $value, int|float $min, int|float $max[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$min : int|float
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allLessThan()

public static allLessThan(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allLessThanEq()

public static allLessThanEq(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allLower()

public static allLower(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allMaxCount()

public static allMaxCount(iterable<string|int, Countable|array<string|int, mixed>> $array, int|float $max[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>>
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

allMaxLength()

public static allMaxLength(iterable<string|int, string> $value, int|float $max[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allMethodExists()

public static allMethodExists(iterable<string|int, string|object> $classOrObject, mixed $method[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object>
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object> $classOrObject

throws
InvalidArgumentException

allMethodNotExists()

public static allMethodNotExists(iterable<string|int, string|object> $classOrObject, mixed $method[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object>
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object> $classOrObject

throws
InvalidArgumentException

allMinCount()

public static allMinCount(iterable<string|int, Countable|array<string|int, mixed>> $array, int|float $min[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>>
$min : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

allMinLength()

public static allMinLength(iterable<string|int, string> $value, int|float $min[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$min : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNatural()

public static allNatural(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<positive-int|0> $value

throws
InvalidArgumentException

allNotContains()

public static allNotContains(iterable<string|int, string> $value, string $subString[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotEmpty()

public static allNotEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotEndsWith()

public static allNotEndsWith(iterable<string|int, string> $value, string $suffix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotEq()

public static allNotEq(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNotFalse()

public static allNotFalse(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotInstanceOf()

public static allNotInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

throws
InvalidArgumentException

allNotNull()

public static allNotNull(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotRegex()

public static allNotRegex(iterable<string|int, string> $value, string $pattern[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotSame()

public static allNotSame(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotStartsWith()

public static allNotStartsWith(iterable<string|int, string> $value, string $prefix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNotWhitespaceOnly()

public static allNotWhitespaceOnly(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNull()

public static allNull(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allNullOrAlnum()

public static allNullOrAlnum(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrAlpha()

public static allNullOrAlpha(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrBoolean()

public static allNullOrBoolean(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<bool|null> $value

throws
InvalidArgumentException

allNullOrClassExists()

public static allNullOrClassExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

iterable<class-string|null> $value

throws
InvalidArgumentException

allNullOrContains()

public static allNullOrContains(iterable<string|int, string|null> $value, string $subString[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrCount()

public static allNullOrCount(iterable<string|int, Countable|array<string|int, mixed>|null> $array, int $number[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>|null>
$number : int
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrCountBetween()

public static allNullOrCountBetween(iterable<string|int, Countable|array<string|int, mixed>|null> $array, int|float $min, int|float $max[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>|null>
$min : int|float
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrDigits()

public static allNullOrDigits(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrDirectory()

public static allNullOrDirectory(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrEmail()

public static allNullOrEmail(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrEndsWith()

public static allNullOrEndsWith(iterable<string|int, string|null> $value, string $suffix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrEq()

public static allNullOrEq(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrFalse()

public static allNullOrFalse(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<false|null> $value

throws
InvalidArgumentException

allNullOrFile()

public static allNullOrFile(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrFileExists()

public static allNullOrFileExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrFloat()

public static allNullOrFloat(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<float|null> $value

throws
InvalidArgumentException

allNullOrGreaterThan()

public static allNullOrGreaterThan(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrGreaterThanEq()

public static allNullOrGreaterThanEq(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrImplementsInterface()

public static allNullOrImplementsInterface(mixed $value, mixed $interface[, string $message = '' ]) : void
Parameters
$value : mixed
$interface : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $interface

psalm-assert

iterable<class-string<ExpectedType>|null> $value

throws
InvalidArgumentException

allNullOrInArray()

public static allNullOrInArray(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : void
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrInteger()

public static allNullOrInteger(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<int|null> $value

throws
InvalidArgumentException

allNullOrIntegerish()

public static allNullOrIntegerish(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<numeric|null> $value

throws
InvalidArgumentException

allNullOrInterfaceExists()

public static allNullOrInterfaceExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

iterable<class-string|null> $value

throws
InvalidArgumentException

allNullOrIp()

public static allNullOrIp(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrIpv4()

public static allNullOrIpv4(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrIpv6()

public static allNullOrIpv6(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrIsAnyOf()

public static allNullOrIsAnyOf(iterable<string|int, object|string|null> $value, array<string|int, string> $classes[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, object|string|null>
$classes : array<string|int, string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

allNullOrIsAOf()

public static allNullOrIsAOf(iterable<string|int, object|string|null> $value, string $class[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, object|string|null>
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

iterable<ExpectedType|class-string<ExpectedType>|null> $value

throws
InvalidArgumentException

allNullOrIsArray()

public static allNullOrIsArray(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<array|null> $value

throws
InvalidArgumentException

allNullOrIsArrayAccessible()

public static allNullOrIsArrayAccessible(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<array|ArrayAccess|null> $value

throws
InvalidArgumentException

allNullOrIsCallable()

public static allNullOrIsCallable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<callable|null> $value

throws
InvalidArgumentException

allNullOrIsCountable()

public static allNullOrIsCountable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<countable|null> $value

throws
InvalidArgumentException

allNullOrIsEmpty()

public static allNullOrIsEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<empty|null> $value

throws
InvalidArgumentException

allNullOrIsInstanceOf()

public static allNullOrIsInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

iterable<ExpectedType|null> $value

throws
InvalidArgumentException

allNullOrIsInstanceOfAny()

public static allNullOrIsInstanceOfAny(mixed $value, array<string|int, object|string> $classes[, string $message = '' ]) : void
Parameters
$value : mixed
$classes : array<string|int, object|string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

allNullOrIsIterable()

public static allNullOrIsIterable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<iterable|null> $value

throws
InvalidArgumentException

allNullOrIsList()

public static allNullOrIsList(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<list|null> $array

throws
InvalidArgumentException

allNullOrIsMap()

public static allNullOrIsMap(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

iterable<mixed|array<T>|null> $array

psalm-assert

iterable<array<string, T>|null> $array

throws
InvalidArgumentException

allNullOrIsNonEmptyList()

public static allNullOrIsNonEmptyList(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<non-empty-list|null> $array

throws
InvalidArgumentException

allNullOrIsNonEmptyMap()

public static allNullOrIsNonEmptyMap(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

iterable<mixed|array<T>|null> $array

psalm-assert

iterable<array<string, T>|null> $array

psalm-assert

iterable<!empty|null> $array

throws
InvalidArgumentException

allNullOrIsNotA()

public static allNullOrIsNotA(iterable<string|int, object|string|null> $value, string $class[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, object|string|null>
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

UnexpectedType of object

psalm-param

class-string<UnexpectedType> $class

psalm-assert

iterable<!UnexpectedType|null> $value

psalm-assert

iterable<!class-string<UnexpectedType>|null> $value

throws
InvalidArgumentException

allNullOrIsTraversable()

public static allNullOrIsTraversable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<iterable|null> $value

deprecated

use "isIterable" or "isInstanceOf" instead

throws
InvalidArgumentException

allNullOrKeyExists()

public static allNullOrKeyExists(iterable<string|int, array<string|int, mixed>|null> $array, string|int $key[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, array<string|int, mixed>|null>
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrKeyNotExists()

public static allNullOrKeyNotExists(iterable<string|int, array<string|int, mixed>|null> $array, string|int $key[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, array<string|int, mixed>|null>
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrLength()

public static allNullOrLength(iterable<string|int, string|null> $value, int $length[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$length : int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrLengthBetween()

public static allNullOrLengthBetween(iterable<string|int, string|null> $value, int|float $min, int|float $max[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$min : int|float
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrLessThan()

public static allNullOrLessThan(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrLessThanEq()

public static allNullOrLessThanEq(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrLower()

public static allNullOrLower(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<lowercase-string|null> $value

throws
InvalidArgumentException

allNullOrMaxCount()

public static allNullOrMaxCount(iterable<string|int, Countable|array<string|int, mixed>|null> $array, int|float $max[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>|null>
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrMaxLength()

public static allNullOrMaxLength(iterable<string|int, string|null> $value, int|float $max[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrMethodExists()

public static allNullOrMethodExists(iterable<string|int, string|object|null> $classOrObject, mixed $method[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object|null>
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object|null> $classOrObject

throws
InvalidArgumentException

allNullOrMethodNotExists()

public static allNullOrMethodNotExists(iterable<string|int, string|object|null> $classOrObject, mixed $method[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object|null>
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object|null> $classOrObject

throws
InvalidArgumentException

allNullOrMinCount()

public static allNullOrMinCount(iterable<string|int, Countable|array<string|int, mixed>|null> $array, int|float $min[, string $message = '' ]) : void
Parameters
$array : iterable<string|int, Countable|array<string|int, mixed>|null>
$min : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrMinLength()

public static allNullOrMinLength(iterable<string|int, string|null> $value, int|float $min[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$min : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrNatural()

public static allNullOrNatural(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<positive-int|0|null> $value

throws
InvalidArgumentException

allNullOrNotContains()

public static allNullOrNotContains(iterable<string|int, string|null> $value, string $subString[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrNotEmpty()

public static allNullOrNotEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<!empty|null> $value

throws
InvalidArgumentException

allNullOrNotEndsWith()

public static allNullOrNotEndsWith(iterable<string|int, string|null> $value, string $suffix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrNotEq()

public static allNullOrNotEq(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrNotFalse()

public static allNullOrNotFalse(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<!false|null> $value

throws
InvalidArgumentException

allNullOrNotInstanceOf()

public static allNullOrNotInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

iterable<!ExpectedType|null> $value

throws
InvalidArgumentException

allNullOrNotRegex()

public static allNullOrNotRegex(iterable<string|int, string|null> $value, string $pattern[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrNotSame()

public static allNullOrNotSame(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrNotStartsWith()

public static allNullOrNotStartsWith(iterable<string|int, string|null> $value, string $prefix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrNotWhitespaceOnly()

public static allNullOrNotWhitespaceOnly(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrNumeric()

public static allNullOrNumeric(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<numeric|null> $value

throws
InvalidArgumentException

allNullOrObject()

public static allNullOrObject(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<object|null> $value

throws
InvalidArgumentException

allNullOrOneOf()

public static allNullOrOneOf(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : void
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrPositiveInteger()

public static allNullOrPositiveInteger(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<positive-int|null> $value

throws
InvalidArgumentException

allNullOrPropertyExists()

public static allNullOrPropertyExists(iterable<string|int, string|object|null> $classOrObject, mixed $property[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object|null>
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object|null> $classOrObject

throws
InvalidArgumentException

allNullOrPropertyNotExists()

public static allNullOrPropertyNotExists(iterable<string|int, string|object|null> $classOrObject, mixed $property[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object|null>
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object|null> $classOrObject

throws
InvalidArgumentException

allNullOrRange()

public static allNullOrRange(mixed $value, mixed $min, mixed $max[, string $message = '' ]) : void
Parameters
$value : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrReadable()

public static allNullOrReadable(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrRegex()

public static allNullOrRegex(iterable<string|int, string|null> $value, string $pattern[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrResource()

public static allNullOrResource(mixed $value[, string|null $type = null ][, string $message = '' ]) : void
Parameters
$value : mixed
$type : string|null = null

type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php

$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<resource|null> $value

throws
InvalidArgumentException

allNullOrSame()

public static allNullOrSame(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrScalar()

public static allNullOrScalar(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<scalar|null> $value

throws
InvalidArgumentException

allNullOrStartsWith()

public static allNullOrStartsWith(iterable<string|int, string|null> $value, string $prefix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrStartsWithLetter()

public static allNullOrStartsWithLetter(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrString()

public static allNullOrString(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<string|null> $value

throws
InvalidArgumentException

allNullOrStringNotEmpty()

public static allNullOrStringNotEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<non-empty-string|null> $value

throws
InvalidArgumentException

allNullOrSubclassOf()

public static allNullOrSubclassOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

iterable<class-string<ExpectedType>|ExpectedType|null> $value

throws
InvalidArgumentException

allNullOrThrows()

public static allNullOrThrows(iterable<string|int, Closure|null> $expression[, string $class = 'Exception' ][, string $message = '' ]) : void
Parameters
$expression : iterable<string|int, Closure|null>
$class : string = 'Exception'
$message : string = ''
Tags
psalm-param

class-string<Throwable> $class

throws
InvalidArgumentException

allNullOrTrue()

public static allNullOrTrue(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<true|null> $value

throws
InvalidArgumentException

allNullOrUnicodeLetters()

public static allNullOrUnicodeLetters(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrUniqueValues()

public static allNullOrUniqueValues(iterable<string|int, array<string|int, mixed>|null> $values[, string $message = '' ]) : void
Parameters
$values : iterable<string|int, array<string|int, mixed>|null>
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrUpper()

public static allNullOrUpper(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<!lowercase-string|null> $value

throws
InvalidArgumentException

allNullOrUuid()

public static allNullOrUuid(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrValidArrayKey()

public static allNullOrValidArrayKey(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable<array-key|null> $value

throws
InvalidArgumentException

allNullOrWritable()

public static allNullOrWritable(iterable<string|int, string|null> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string|null>
$message : string = ''
Tags
throws
InvalidArgumentException

allNumeric()

public static allNumeric(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allObject()

public static allObject(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allOneOf()

public static allOneOf(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : void
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allPositiveInteger()

public static allPositiveInteger(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allPropertyExists()

public static allPropertyExists(iterable<string|int, string|object> $classOrObject, mixed $property[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object>
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object> $classOrObject

throws
InvalidArgumentException

allPropertyNotExists()

public static allPropertyNotExists(iterable<string|int, string|object> $classOrObject, mixed $property[, string $message = '' ]) : void
Parameters
$classOrObject : iterable<string|int, string|object>
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

iterable<class-string|object> $classOrObject

throws
InvalidArgumentException

allRange()

public static allRange(mixed $value, mixed $min, mixed $max[, string $message = '' ]) : void
Parameters
$value : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allReadable()

public static allReadable(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
throws
InvalidArgumentException

allRegex()

public static allRegex(iterable<string|int, string> $value, string $pattern[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allResource()

public static allResource(mixed $value[, string|null $type = null ][, string $message = '' ]) : void
Parameters
$value : mixed
$type : string|null = null

type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php

$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allSame()

public static allSame(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allScalar()

public static allScalar(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allStartsWith()

public static allStartsWith(iterable<string|int, string> $value, string $prefix[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allStartsWithLetter()

public static allStartsWithLetter(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allString()

public static allString(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allStringNotEmpty()

public static allStringNotEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allSubclassOf()

public static allSubclassOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

iterable<class-string<ExpectedType>|ExpectedType> $value

throws
InvalidArgumentException

allThrows()

public static allThrows(iterable<string|int, Closure$expression[, string $class = 'Exception' ][, string $message = '' ]) : void
Parameters
$expression : iterable<string|int, Closure>
$class : string = 'Exception'
$message : string = ''
Tags
psalm-param

class-string<Throwable> $class

throws
InvalidArgumentException

allTrue()

public static allTrue(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allUnicodeLetters()

public static allUnicodeLetters(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allUniqueValues()

public static allUniqueValues(iterable<string|int, array<string|int, mixed>> $values[, string $message = '' ]) : void
Parameters
$values : iterable<string|int, array<string|int, mixed>>
$message : string = ''
Tags
throws
InvalidArgumentException

allUpper()

public static allUpper(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allUuid()

public static allUuid(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allValidArrayKey()

public static allValidArrayKey(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

allWritable()

public static allWritable(iterable<string|int, string> $value[, string $message = '' ]) : void
Parameters
$value : iterable<string|int, string>
$message : string = ''
Tags
throws
InvalidArgumentException

alnum()

public static alnum(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

alpha()

public static alpha(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

boolean()

public static boolean(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

bool $value

throws
InvalidArgumentException

classExists()

public static classExists(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

class-string $value

throws
InvalidArgumentException

contains()

public static contains(string $value, string $subString[, string $message = '' ]) : mixed
Parameters
$value : string
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

count()

Does not check if $array is countable, this can generate a warning on php versions after 7.2.

public static count(Countable|array<string|int, mixed> $array, int $number[, string $message = '' ]) : mixed
Parameters
$array : Countable|array<string|int, mixed>
$number : int
$message : string = ''
Tags
throws
InvalidArgumentException

countBetween()

Does not check if $array is countable, this can generate a warning on php versions after 7.2.

public static countBetween(Countable|array<string|int, mixed> $array, int|float $min, int|float $max[, string $message = '' ]) : mixed
Parameters
$array : Countable|array<string|int, mixed>
$min : int|float
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

digits()

public static digits(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

directory()

public static directory(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

email()

public static email(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

endsWith()

public static endsWith(string $value, string $suffix[, string $message = '' ]) : mixed
Parameters
$value : string
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

eq()

public static eq(mixed $value, mixed $expect[, string $message = '' ]) : mixed
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

false()

public static false(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

false $value

throws
InvalidArgumentException

file()

public static file(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

fileExists()

Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file.

public static fileExists(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

float()

public static float(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

float $value

throws
InvalidArgumentException

greaterThan()

public static greaterThan(mixed $value, mixed $limit[, string $message = '' ]) : mixed
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

greaterThanEq()

public static greaterThanEq(mixed $value, mixed $limit[, string $message = '' ]) : mixed
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

implementsInterface()

public static implementsInterface(mixed $value, mixed $interface[, string $message = '' ]) : mixed
Parameters
$value : mixed
$interface : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $interface

psalm-assert

class-string<ExpectedType> $value

throws
InvalidArgumentException

inArray()

Does strict comparison, so Assert::inArray(3, ['3']) does not pass the assertion.

public static inArray(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : mixed
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

integer()

public static integer(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

int $value

throws
InvalidArgumentException

integerish()

public static integerish(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

numeric $value

throws
InvalidArgumentException

interfaceExists()

public static interfaceExists(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

class-string $value

throws
InvalidArgumentException

ip()

public static ip(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

ipv4()

public static ipv4(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

ipv6()

public static ipv6(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

isAnyOf()

public static isAnyOf(object|string $value, array<string|int, string> $classes[, string $message = '' ]) : mixed
Parameters
$value : object|string
$classes : array<string|int, string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

isAOf()

public static isAOf(object|string $value, string $class[, string $message = '' ]) : mixed
Parameters
$value : object|string
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

ExpectedType|class-string<ExpectedType> $value

throws
InvalidArgumentException

isArray()

public static isArray(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array $value

throws
InvalidArgumentException

isArrayAccessible()

public static isArrayAccessible(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array|ArrayAccess $value

throws
InvalidArgumentException

isCallable()

public static isCallable(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

callable $value

throws
InvalidArgumentException

isCountable()

public static isCountable(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

countable $value

throws
InvalidArgumentException

isEmpty()

public static isEmpty(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

empty $value

throws
InvalidArgumentException

isInstanceOf()

public static isInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : mixed
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

ExpectedType $value

throws
InvalidArgumentException

isInstanceOfAny()

public static isInstanceOfAny(mixed $value, array<string|int, object|string> $classes[, string $message = '' ]) : mixed
Parameters
$value : mixed
$classes : array<string|int, object|string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

isIterable()

public static isIterable(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

throws
InvalidArgumentException

isList()

public static isList(mixed $array[, string $message = '' ]) : mixed
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

list $array

throws
InvalidArgumentException

isMap()

public static isMap(mixed $array[, string $message = '' ]) : mixed
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

mixed|array<T> $array

psalm-assert

array<string, T> $array

throws
InvalidArgumentException

isNonEmptyList()

public static isNonEmptyList(mixed $array[, string $message = '' ]) : mixed
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

non-empty-list $array

throws
InvalidArgumentException

isNonEmptyMap()

public static isNonEmptyMap(mixed $array[, string $message = '' ]) : mixed
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

mixed|array<T> $array

psalm-assert

array<string, T> $array

psalm-assert

!empty $array

throws
InvalidArgumentException

isNotA()

public static isNotA(object|string $value, string $class[, string $message = '' ]) : mixed
Parameters
$value : object|string
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

UnexpectedType of object

psalm-param

class-string<UnexpectedType> $class

psalm-assert

!UnexpectedType $value

psalm-assert

!class-string<UnexpectedType> $value

throws
InvalidArgumentException

isTraversable()

public static isTraversable(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable $value

deprecated

use "isIterable" or "isInstanceOf" instead

throws
InvalidArgumentException

keyExists()

public static keyExists(array<string|int, mixed> $array, string|int $key[, string $message = '' ]) : mixed
Parameters
$array : array<string|int, mixed>
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

keyNotExists()

public static keyNotExists(array<string|int, mixed> $array, string|int $key[, string $message = '' ]) : mixed
Parameters
$array : array<string|int, mixed>
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

length()

public static length(string $value, int $length[, string $message = '' ]) : mixed
Parameters
$value : string
$length : int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

lengthBetween()

Inclusive , so Assert::lengthBetween('asd', 3, 5); passes the assertion.

public static lengthBetween(string $value, int|float $min, int|float $max[, string $message = '' ]) : mixed
Parameters
$value : string
$min : int|float
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

lessThan()

public static lessThan(mixed $value, mixed $limit[, string $message = '' ]) : mixed
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

lessThanEq()

public static lessThanEq(mixed $value, mixed $limit[, string $message = '' ]) : mixed
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

lower()

public static lower(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
psalm-pure
psalm-assert

lowercase-string $value

throws
InvalidArgumentException

maxCount()

Does not check if $array is countable, this can generate a warning on php versions after 7.2.

public static maxCount(Countable|array<string|int, mixed> $array, int|float $max[, string $message = '' ]) : mixed
Parameters
$array : Countable|array<string|int, mixed>
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

maxLength()

Inclusive max.

public static maxLength(string $value, int|float $max[, string $message = '' ]) : mixed
Parameters
$value : string
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

methodExists()

public static methodExists(string|object $classOrObject, mixed $method[, string $message = '' ]) : mixed
Parameters
$classOrObject : string|object
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object $classOrObject

throws
InvalidArgumentException

methodNotExists()

public static methodNotExists(string|object $classOrObject, mixed $method[, string $message = '' ]) : mixed
Parameters
$classOrObject : string|object
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object $classOrObject

throws
InvalidArgumentException

minCount()

Does not check if $array is countable, this can generate a warning on php versions after 7.2.

public static minCount(Countable|array<string|int, mixed> $array, int|float $min[, string $message = '' ]) : mixed
Parameters
$array : Countable|array<string|int, mixed>
$min : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

minLength()

Inclusive min.

public static minLength(string $value, int|float $min[, string $message = '' ]) : mixed
Parameters
$value : string
$min : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

natural()

public static natural(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

positive-int|0 $value

throws
InvalidArgumentException

notContains()

public static notContains(string $value, string $subString[, string $message = '' ]) : mixed
Parameters
$value : string
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

notEmpty()

public static notEmpty(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

!empty $value

throws
InvalidArgumentException

notEndsWith()

public static notEndsWith(string $value, string $suffix[, string $message = '' ]) : mixed
Parameters
$value : string
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

notEq()

public static notEq(mixed $value, mixed $expect[, string $message = '' ]) : mixed
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

notFalse()

public static notFalse(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

!false $value

throws
InvalidArgumentException

notInstanceOf()

public static notInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : mixed
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

!ExpectedType $value

throws
InvalidArgumentException

notNull()

public static notNull(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

!null $value

throws
InvalidArgumentException

notRegex()

public static notRegex(string $value, string $pattern[, string $message = '' ]) : mixed
Parameters
$value : string
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

notSame()

public static notSame(mixed $value, mixed $expect[, string $message = '' ]) : mixed
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

notStartsWith()

public static notStartsWith(string $value, string $prefix[, string $message = '' ]) : mixed
Parameters
$value : string
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

notWhitespaceOnly()

public static notWhitespaceOnly(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

null()

public static null(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

null $value

throws
InvalidArgumentException

nullOrAlnum()

public static nullOrAlnum(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrAlpha()

public static nullOrAlpha(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrBoolean()

public static nullOrBoolean(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

bool|null $value

throws
InvalidArgumentException

nullOrClassExists()

public static nullOrClassExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

class-string|null $value

throws
InvalidArgumentException

nullOrContains()

public static nullOrContains(string|null $value, string $subString[, string $message = '' ]) : void
Parameters
$value : string|null
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrCount()

public static nullOrCount(Countable|array<string|int, mixed>|null $array, int $number[, string $message = '' ]) : void
Parameters
$array : Countable|array<string|int, mixed>|null
$number : int
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrCountBetween()

public static nullOrCountBetween(Countable|array<string|int, mixed>|null $array, int|float $min, int|float $max[, string $message = '' ]) : void
Parameters
$array : Countable|array<string|int, mixed>|null
$min : int|float
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrDigits()

public static nullOrDigits(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrDirectory()

public static nullOrDirectory(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrEmail()

public static nullOrEmail(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrEndsWith()

public static nullOrEndsWith(string|null $value, string $suffix[, string $message = '' ]) : void
Parameters
$value : string|null
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrEq()

public static nullOrEq(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrFalse()

public static nullOrFalse(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

false|null $value

throws
InvalidArgumentException

nullOrFile()

public static nullOrFile(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrFileExists()

public static nullOrFileExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrFloat()

public static nullOrFloat(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

float|null $value

throws
InvalidArgumentException

nullOrGreaterThan()

public static nullOrGreaterThan(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrGreaterThanEq()

public static nullOrGreaterThanEq(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrImplementsInterface()

public static nullOrImplementsInterface(mixed $value, mixed $interface[, string $message = '' ]) : void
Parameters
$value : mixed
$interface : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $interface

psalm-assert

class-string<ExpectedType>|null $value

throws
InvalidArgumentException

nullOrInArray()

public static nullOrInArray(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : void
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrInteger()

public static nullOrInteger(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

int|null $value

throws
InvalidArgumentException

nullOrIntegerish()

public static nullOrIntegerish(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

numeric|null $value

throws
InvalidArgumentException

nullOrInterfaceExists()

public static nullOrInterfaceExists(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-assert

class-string|null $value

throws
InvalidArgumentException

nullOrIp()

public static nullOrIp(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrIpv4()

public static nullOrIpv4(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrIpv6()

public static nullOrIpv6(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrIsAnyOf()

public static nullOrIsAnyOf(object|string|null $value, array<string|int, string> $classes[, string $message = '' ]) : void
Parameters
$value : object|string|null
$classes : array<string|int, string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

nullOrIsAOf()

public static nullOrIsAOf(object|string|null $value, string $class[, string $message = '' ]) : void
Parameters
$value : object|string|null
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

ExpectedType|class-string<ExpectedType>|null $value

throws
InvalidArgumentException

nullOrIsArray()

public static nullOrIsArray(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array|null $value

throws
InvalidArgumentException

nullOrIsArrayAccessible()

public static nullOrIsArrayAccessible(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array|ArrayAccess|null $value

throws
InvalidArgumentException

nullOrIsCallable()

public static nullOrIsCallable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

callable|null $value

throws
InvalidArgumentException

nullOrIsCountable()

public static nullOrIsCountable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

countable|null $value

throws
InvalidArgumentException

nullOrIsEmpty()

public static nullOrIsEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

empty $value

throws
InvalidArgumentException

nullOrIsInstanceOf()

public static nullOrIsInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

ExpectedType|null $value

throws
InvalidArgumentException

nullOrIsInstanceOfAny()

public static nullOrIsInstanceOfAny(mixed $value, array<string|int, object|string> $classes[, string $message = '' ]) : void
Parameters
$value : mixed
$classes : array<string|int, object|string>
$message : string = ''
Tags
psalm-pure
psalm-param

array $classes

throws
InvalidArgumentException

nullOrIsIterable()

public static nullOrIsIterable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable|null $value

throws
InvalidArgumentException

nullOrIsList()

public static nullOrIsList(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

list|null $array

throws
InvalidArgumentException

nullOrIsMap()

public static nullOrIsMap(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

mixed|array<T>|null $array

psalm-assert

array<string, T>|null $array

throws
InvalidArgumentException

nullOrIsNonEmptyList()

public static nullOrIsNonEmptyList(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

non-empty-list|null $array

throws
InvalidArgumentException

nullOrIsNonEmptyMap()

public static nullOrIsNonEmptyMap(mixed $array[, string $message = '' ]) : void
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-template

T

psalm-param

mixed|array<T>|null $array

throws
InvalidArgumentException

nullOrIsNotA()

public static nullOrIsNotA(object|string|null $value, string $class[, string $message = '' ]) : void
Parameters
$value : object|string|null
$class : string
$message : string = ''
Tags
psalm-pure
psalm-template

UnexpectedType of object

psalm-param

class-string<UnexpectedType> $class

throws
InvalidArgumentException

nullOrIsTraversable()

public static nullOrIsTraversable(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

iterable|null $value

deprecated

use "isIterable" or "isInstanceOf" instead

throws
InvalidArgumentException

nullOrKeyExists()

public static nullOrKeyExists(array<string|int, mixed>|null $array, string|int $key[, string $message = '' ]) : void
Parameters
$array : array<string|int, mixed>|null
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrKeyNotExists()

public static nullOrKeyNotExists(array<string|int, mixed>|null $array, string|int $key[, string $message = '' ]) : void
Parameters
$array : array<string|int, mixed>|null
$key : string|int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrLength()

public static nullOrLength(string|null $value, int $length[, string $message = '' ]) : void
Parameters
$value : string|null
$length : int
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrLengthBetween()

public static nullOrLengthBetween(string|null $value, int|float $min, int|float $max[, string $message = '' ]) : void
Parameters
$value : string|null
$min : int|float
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrLessThan()

public static nullOrLessThan(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrLessThanEq()

public static nullOrLessThanEq(mixed $value, mixed $limit[, string $message = '' ]) : void
Parameters
$value : mixed
$limit : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrLower()

public static nullOrLower(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
psalm-pure
psalm-assert

lowercase-string|null $value

throws
InvalidArgumentException

nullOrMaxCount()

public static nullOrMaxCount(Countable|array<string|int, mixed>|null $array, int|float $max[, string $message = '' ]) : void
Parameters
$array : Countable|array<string|int, mixed>|null
$max : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrMaxLength()

public static nullOrMaxLength(string|null $value, int|float $max[, string $message = '' ]) : void
Parameters
$value : string|null
$max : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrMethodExists()

public static nullOrMethodExists(string|object|null $classOrObject, mixed $method[, string $message = '' ]) : void
Parameters
$classOrObject : string|object|null
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object|null $classOrObject

throws
InvalidArgumentException

nullOrMethodNotExists()

public static nullOrMethodNotExists(string|object|null $classOrObject, mixed $method[, string $message = '' ]) : void
Parameters
$classOrObject : string|object|null
$method : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object|null $classOrObject

throws
InvalidArgumentException

nullOrMinCount()

public static nullOrMinCount(Countable|array<string|int, mixed>|null $array, int|float $min[, string $message = '' ]) : void
Parameters
$array : Countable|array<string|int, mixed>|null
$min : int|float
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrMinLength()

public static nullOrMinLength(string|null $value, int|float $min[, string $message = '' ]) : void
Parameters
$value : string|null
$min : int|float
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNatural()

public static nullOrNatural(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

positive-int|0|null $value

throws
InvalidArgumentException

nullOrNotContains()

public static nullOrNotContains(string|null $value, string $subString[, string $message = '' ]) : void
Parameters
$value : string|null
$subString : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNotEmpty()

public static nullOrNotEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNotEndsWith()

public static nullOrNotEndsWith(string|null $value, string $suffix[, string $message = '' ]) : void
Parameters
$value : string|null
$suffix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNotEq()

public static nullOrNotEq(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrNotFalse()

public static nullOrNotFalse(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNotInstanceOf()

public static nullOrNotInstanceOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

throws
InvalidArgumentException

nullOrNotRegex()

public static nullOrNotRegex(string|null $value, string $pattern[, string $message = '' ]) : void
Parameters
$value : string|null
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNotSame()

public static nullOrNotSame(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNotStartsWith()

public static nullOrNotStartsWith(string|null $value, string $prefix[, string $message = '' ]) : void
Parameters
$value : string|null
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNotWhitespaceOnly()

public static nullOrNotWhitespaceOnly(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrNumeric()

public static nullOrNumeric(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

numeric|null $value

throws
InvalidArgumentException

nullOrObject()

public static nullOrObject(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

object|null $value

throws
InvalidArgumentException

nullOrOneOf()

public static nullOrOneOf(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : void
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrPositiveInteger()

public static nullOrPositiveInteger(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

positive-int|null $value

throws
InvalidArgumentException

nullOrPropertyExists()

public static nullOrPropertyExists(string|object|null $classOrObject, mixed $property[, string $message = '' ]) : void
Parameters
$classOrObject : string|object|null
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object|null $classOrObject

throws
InvalidArgumentException

nullOrPropertyNotExists()

public static nullOrPropertyNotExists(string|object|null $classOrObject, mixed $property[, string $message = '' ]) : void
Parameters
$classOrObject : string|object|null
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object|null $classOrObject

throws
InvalidArgumentException

nullOrRange()

public static nullOrRange(mixed $value, mixed $min, mixed $max[, string $message = '' ]) : void
Parameters
$value : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrReadable()

public static nullOrReadable(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrRegex()

public static nullOrRegex(string|null $value, string $pattern[, string $message = '' ]) : void
Parameters
$value : string|null
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrResource()

public static nullOrResource(mixed $value[, string|null $type = null ][, string $message = '' ]) : void
Parameters
$value : mixed
$type : string|null = null

type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php

$message : string = ''
Tags
psalm-pure
psalm-assert

resource|null $value

throws
InvalidArgumentException

nullOrSame()

public static nullOrSame(mixed $value, mixed $expect[, string $message = '' ]) : void
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrScalar()

public static nullOrScalar(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

scalar|null $value

throws
InvalidArgumentException

nullOrStartsWith()

public static nullOrStartsWith(string|null $value, string $prefix[, string $message = '' ]) : void
Parameters
$value : string|null
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrStartsWithLetter()

public static nullOrStartsWithLetter(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrString()

public static nullOrString(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

string|null $value

throws
InvalidArgumentException

nullOrStringNotEmpty()

public static nullOrStringNotEmpty(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

non-empty-string|null $value

throws
InvalidArgumentException

nullOrSubclassOf()

public static nullOrSubclassOf(mixed $value, string|object $class[, string $message = '' ]) : void
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

class-string<ExpectedType>|ExpectedType|null $value

throws
InvalidArgumentException

nullOrThrows()

public static nullOrThrows(Closure|null $expression[, string $class = 'Exception' ][, string $message = '' ]) : void
Parameters
$expression : Closure|null
$class : string = 'Exception'
$message : string = ''
Tags
psalm-param

class-string<Throwable> $class

throws
InvalidArgumentException

nullOrTrue()

public static nullOrTrue(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

true|null $value

throws
InvalidArgumentException

nullOrUnicodeLetters()

public static nullOrUnicodeLetters(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrUniqueValues()

public static nullOrUniqueValues(array<string|int, mixed>|null $values[, string $message = '' ]) : void
Parameters
$values : array<string|int, mixed>|null
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrUpper()

public static nullOrUpper(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrUuid()

public static nullOrUuid(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrValidArrayKey()

public static nullOrValidArrayKey(mixed $value[, string $message = '' ]) : void
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array-key|null $value

throws
InvalidArgumentException

nullOrWritable()

public static nullOrWritable(string|null $value[, string $message = '' ]) : void
Parameters
$value : string|null
$message : string = ''
Tags
throws
InvalidArgumentException

numeric()

public static numeric(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

numeric $value

throws
InvalidArgumentException

object()

public static object(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

object $value

throws
InvalidArgumentException

oneOf()

A more human-readable alias of Assert::inArray().

public static oneOf(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : mixed
Parameters
$value : mixed
$values : array<string|int, mixed>
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

positiveInteger()

public static positiveInteger(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

positive-int $value

throws
InvalidArgumentException

propertyExists()

public static propertyExists(string|object $classOrObject, mixed $property[, string $message = '' ]) : mixed
Parameters
$classOrObject : string|object
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object $classOrObject

throws
InvalidArgumentException

propertyNotExists()

public static propertyNotExists(string|object $classOrObject, mixed $property[, string $message = '' ]) : mixed
Parameters
$classOrObject : string|object
$property : mixed
$message : string = ''
Tags
psalm-pure
psalm-param

class-string|object $classOrObject

throws
InvalidArgumentException

range()

Inclusive range, so Assert::(3, 3, 5) passes.

public static range(mixed $value, mixed $min, mixed $max[, string $message = '' ]) : mixed
Parameters
$value : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

readable()

public static readable(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
throws
InvalidArgumentException

regex()

public static regex(string $value, string $pattern[, string $message = '' ]) : mixed
Parameters
$value : string
$pattern : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

resource()

public static resource(mixed $value[, string|null $type = null ][, string $message = '' ]) : mixed
Parameters
$value : mixed
$type : string|null = null

type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php

$message : string = ''
Tags
psalm-pure
psalm-assert

resource $value

throws
InvalidArgumentException

same()

public static same(mixed $value, mixed $expect[, string $message = '' ]) : mixed
Parameters
$value : mixed
$expect : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

scalar()

public static scalar(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

scalar $value

throws
InvalidArgumentException

startsWith()

public static startsWith(string $value, string $prefix[, string $message = '' ]) : mixed
Parameters
$value : string
$prefix : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

startsWithLetter()

public static startsWithLetter(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

string()

public static string(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

string $value

throws
InvalidArgumentException

stringNotEmpty()

public static stringNotEmpty(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

non-empty-string $value

throws
InvalidArgumentException

subclassOf()

public static subclassOf(mixed $value, string|object $class[, string $message = '' ]) : mixed
Parameters
$value : mixed
$class : string|object
$message : string = ''
Tags
psalm-pure
psalm-template

ExpectedType of object

psalm-param

class-string<ExpectedType> $class

psalm-assert

class-string<ExpectedType>|ExpectedType $value

throws
InvalidArgumentException

throws()

public static throws(Closure $expression[, string $class = 'Exception' ][, string $message = '' ]) : mixed
Parameters
$expression : Closure
$class : string = 'Exception'
$message : string = ''
Tags
psalm-param

class-string<Throwable> $class

throws
InvalidArgumentException

true()

public static true(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

true $value

throws
InvalidArgumentException

unicodeLetters()

public static unicodeLetters(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

uniqueValues()

Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.

public static uniqueValues(array<string|int, mixed> $values[, string $message = '' ]) : mixed
Parameters
$values : array<string|int, mixed>
$message : string = ''
Tags
throws
InvalidArgumentException

upper()

public static upper(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
psalm-pure
psalm-assert

!lowercase-string $value

throws
InvalidArgumentException

uuid()

public static uuid(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

validArrayKey()

Checks if a value is a valid array key (int or string).

public static validArrayKey(mixed $value[, string $message = '' ]) : mixed
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array-key $value

throws
InvalidArgumentException

writable()

public static writable(string $value[, string $message = '' ]) : mixed
Parameters
$value : string
$message : string = ''
Tags
throws
InvalidArgumentException

reportInvalidArgument()

protected static reportInvalidArgument(string $message) : mixed
Parameters
$message : string
Tags
throws
InvalidArgumentException
psalm-pure

this method is not supposed to perform side-effects

psalm-return

never

strlen()

protected static strlen(mixed $value) : mixed
Parameters
$value : mixed

typeToString()

protected static typeToString(mixed $value) : string
Parameters
$value : mixed
Return values
string

valueToString()

protected static valueToString(mixed $value) : string
Parameters
$value : mixed
Return values
string

__construct()

private __construct() : mixed

        
On this page

Search results