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

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

Methods

allAlnum()

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

allAlpha()

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

allBoolean()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, bool>

allClassExists()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, class-string>

allContains()

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

allCount()

public static allCount(mixed $array, mixed $number[, string $message = '' ]) : mixed
Parameters
$array : mixed
$number : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allCountBetween()

public static allCountBetween(mixed $array, mixed $min, mixed $max[, string $message = '' ]) : mixed
Parameters
$array : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allDigits()

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

allDirectory()

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

allEmail()

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

iterable $value

throws
InvalidArgumentException

allEndsWith()

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

allEq()

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

allFalse()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, false>

allFile()

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

allFileExists()

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

allFloat()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, float>

allGreaterThan()

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

allGreaterThanEq()

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

allImplementsInterface()

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

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

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType>|ExpectedType>

allInArray()

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

allInteger()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, int>

allIntegerish()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, numeric-string|int|float>

allInterfaceExists()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, class-string>

allIp()

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

iterable $value

throws
InvalidArgumentException

allIpv4()

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

iterable $value

throws
InvalidArgumentException

allIpv6()

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

iterable $value

throws
InvalidArgumentException

allIsAnyOf()

public static allIsAnyOf(iterable<string|int, object|string> $value, array<string|int, string> $classes[, string $message = '' ]) : mixed
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, ExpectedType|ExpectedType>$value, ExpectedType> $class[, string $message = '' ]) : iterable<string|int, ExpectedType|ExpectedType>>
Parameters
$value : iterable<string|int, ExpectedType|ExpectedType>>
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

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

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType|ExpectedType>>

allIsArray()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, array<string|int, mixed>>

allIsArrayAccessible()

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

iterable<array|ArrayAccess> $value

throws
InvalidArgumentException
Return values
iterable<string|int, array<string|int, mixed>|ArrayAccess>

allIsCallable()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, callable>

allIsCountable()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, countable>

allIsEmpty()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, empty>

allIsInstanceOf()

public static allIsInstanceOf(iterable<string|int, mixed> $value, ExpectedType> $class[, string $message = '' ]) : iterable<string|int, ExpectedType>
Parameters
$value : iterable<string|int, mixed>
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

iterable<ExpectedType> $value

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType>

allIsInstanceOfAny()

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

array $classes

throws
InvalidArgumentException

allIsIterable()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, iterable<string|int, mixed>>

allIsList()

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

iterable $array

throws
InvalidArgumentException
Return values
iterable<string|int, array<int, mixed>>

allIsMap()

public static allIsMap(iterable<string|int, mixed|array<string|int, T>> $array[, string $message = '' ]) : iterable<string|int, array<string, T>>
Parameters
$array : iterable<string|int, mixed|array<string|int, T>>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

iterable<array<string, T>> $array

throws
InvalidArgumentException
Return values
iterable<string|int, array<string, T>>

allIsNonEmptyList()

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

iterable $array

throws
InvalidArgumentException
Return values
iterable<string|int, array<int, mixed>>

allIsNonEmptyMap()

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

allIsNotA()

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

allIsStatic()

public static allIsStatic(iterable<string|int, Closure|callable> $callable[, string $message = '' ]) : iterable<string|int, callable>
Parameters
$callable : iterable<string|int, Closure|callable>
$message : string = ''
Tags
psalm-assert

iterable $callable

throws
InvalidArgumentException
Return values
iterable<string|int, callable>

allKeyExists()

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

allKeyNotExists()

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

allLength()

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

allLengthBetween()

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

allLessThan()

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

allLessThanEq()

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

allLower()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, lowercase-string>

allMaxCount()

public static allMaxCount(mixed $array, mixed $max[, string $message = '' ]) : mixed
Parameters
$array : mixed
$max : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allMaxLength()

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

allMethodExists()

public static allMethodExists(iterable<string|int, string|object> $classOrObject, mixed $method[, string $message = '' ]) : mixed
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 = '' ]) : mixed
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(mixed $array, mixed $min[, string $message = '' ]) : mixed
Parameters
$array : mixed
$min : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allMinLength()

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

allNatural()

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

iterable<positive-int|0> $value

throws
InvalidArgumentException
Return values
iterable<string|int, positive-int|0>

allNegativeInteger()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, negative-int>

allNotContains()

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

allNotEmpty()

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

allNotEndsWith()

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

allNotEq()

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

allNotFalse()

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

allNotInArray()

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

allNotInstanceOf()

public static allNotInstanceOf(iterable<string|int, mixed> $value, ExpectedType> $class[, string $message = '' ]) : mixed
Parameters
$value : iterable<string|int, mixed>
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
throws
InvalidArgumentException

allNotNegativeInteger()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>

allNotNull()

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

allNotOneOf()

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

allNotRegex()

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

allNotSame()

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

allNotStartsWith()

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

allNotStatic()

public static allNotStatic(iterable<string|int, Closure|callable> $callable[, string $message = '' ]) : iterable<string|int, callable>
Parameters
$callable : iterable<string|int, Closure|callable>
$message : string = ''
Tags
psalm-assert

iterable $callable

throws
InvalidArgumentException
Return values
iterable<string|int, callable>

allNotWhitespaceOnly()

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

allNull()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, null>

allNullOrAlnum()

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

allNullOrAlpha()

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

allNullOrBoolean()

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

iterable<bool|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, bool|null>

allNullOrClassExists()

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

iterable<class-string|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, class-string|null>

allNullOrContains()

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

allNullOrCount()

public static allNullOrCount(mixed $array, mixed $number[, string $message = '' ]) : mixed
Parameters
$array : mixed
$number : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrCountBetween()

public static allNullOrCountBetween(mixed $array, mixed $min, mixed $max[, string $message = '' ]) : mixed
Parameters
$array : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrDigits()

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

allNullOrDirectory()

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

allNullOrEmail()

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

iterable<string|null> $value

throws
InvalidArgumentException

allNullOrEndsWith()

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

allNullOrEq()

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

allNullOrFalse()

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

iterable<false|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, false|null>

allNullOrFile()

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

allNullOrFileExists()

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

allNullOrFloat()

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

iterable<float|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, float|null>

allNullOrGreaterThan()

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

allNullOrGreaterThanEq()

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

allNullOrImplementsInterface()

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

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

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType>|ExpectedType|null>

allNullOrInArray()

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

allNullOrInteger()

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

iterable<int|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, int|null>

allNullOrIntegerish()

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

iterable<numeric|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, (numeric)|null>

allNullOrInterfaceExists()

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

iterable<class-string|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, class-string|null>

allNullOrIp()

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

iterable<string|null> $value

throws
InvalidArgumentException

allNullOrIpv4()

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

iterable<string|null> $value

throws
InvalidArgumentException

allNullOrIpv6()

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

iterable<string|null> $value

throws
InvalidArgumentException

allNullOrIsAnyOf()

public static allNullOrIsAnyOf(iterable<string|int, object|string|null> $value, array<string|int, string> $classes[, string $message = '' ]) : mixed
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, ExpectedType|ExpectedType>|null> $value, ExpectedType> $class[, string $message = '' ]) : iterable<string|int, ExpectedType|ExpectedType>|null>
Parameters
$value : iterable<string|int, ExpectedType|ExpectedType>|null>
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

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

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType|ExpectedType>|null>

allNullOrIsArray()

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

iterable<array|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, array<string|int, mixed>|null>

allNullOrIsArrayAccessible()

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

iterable<array|ArrayAccess|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, array<string|int, mixed>|ArrayAccess|null>

allNullOrIsCallable()

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

iterable<callable|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, callable|null>

allNullOrIsCountable()

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

iterable<countable|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, countable|null>

allNullOrIsEmpty()

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

iterable<empty|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, empty|null>

allNullOrIsInstanceOf()

public static allNullOrIsInstanceOf(iterable<string|int, mixed>|null $value, ExpectedType> $class[, string $message = '' ]) : iterable<string|int, ExpectedType|null>
Parameters
$value : iterable<string|int, mixed>|null
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

iterable<ExpectedType|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType|null>

allNullOrIsInstanceOfAny()

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

array $classes

throws
InvalidArgumentException

allNullOrIsIterable()

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

iterable<iterable|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, iterable<string|int, mixed>|null>

allNullOrIsList()

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

iterable<list|null> $array

throws
InvalidArgumentException
Return values
iterable<string|int, array<int, mixed>|null>

allNullOrIsMap()

public static allNullOrIsMap(iterable<string|int, mixed|array<string|int, T>|null> $array[, string $message = '' ]) : iterable<string|int, array<string, T>|null>
Parameters
$array : iterable<string|int, mixed|array<string|int, T>|null>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

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

throws
InvalidArgumentException
Return values
iterable<string|int, array<string, T>|null>

allNullOrIsNonEmptyList()

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

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

throws
InvalidArgumentException
Return values
iterable<string|int, array<int, mixed>|null>

allNullOrIsNonEmptyMap()

public static allNullOrIsNonEmptyMap(iterable<string|int, array<string, T>|null> $array[, string $message = '' ]) : mixed
Parameters
$array : iterable<string|int, array<string, T>|null>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

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

psalm-assert

iterable $array

@return

iterable

throws
InvalidArgumentException

allNullOrIsNotA()

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

allNullOrIsStatic()

public static allNullOrIsStatic(iterable<string|int, Closure|callable|null> $callable[, string $message = '' ]) : iterable<string|int, callable|null>
Parameters
$callable : iterable<string|int, Closure|callable|null>
$message : string = ''
Tags
psalm-assert

iterable<callable|null> $callable

throws
InvalidArgumentException
Return values
iterable<string|int, callable|null>

allNullOrKeyExists()

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

allNullOrKeyNotExists()

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

allNullOrLength()

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

allNullOrLengthBetween()

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

allNullOrLessThan()

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

allNullOrLessThanEq()

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

allNullOrLower()

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

iterable<lowercase-string|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, lowercase-string|null>

allNullOrMaxCount()

public static allNullOrMaxCount(mixed $array, mixed $max[, string $message = '' ]) : mixed
Parameters
$array : mixed
$max : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrMaxLength()

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

allNullOrMethodExists()

public static allNullOrMethodExists(iterable<string|int, string|object|null> $classOrObject, mixed $method[, string $message = '' ]) : mixed
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 = '' ]) : mixed
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(mixed $array, mixed $min[, string $message = '' ]) : mixed
Parameters
$array : mixed
$min : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

allNullOrMinLength()

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

allNullOrNatural()

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

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

throws
InvalidArgumentException
Return values
iterable<string|int, positive-int|0|null>

allNullOrNegativeInteger()

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

iterable<negative-int|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, negative-int|null>

allNullOrNotContains()

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

allNullOrNotEmpty()

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

iterable $value

@return

iterable

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>|null

allNullOrNotEndsWith()

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

allNullOrNotEq()

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

allNullOrNotFalse()

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

iterable $value

@return

iterable

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>|null

allNullOrNotInArray()

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

allNullOrNotInstanceOf()

public static allNullOrNotInstanceOf(iterable<string|int, mixed>|null $value, ExpectedType> $class[, string $message = '' ]) : iterable<string|int, mixed>|null
Parameters
$value : iterable<string|int, mixed>|null
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

iterable $value

@return

iterable

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>|null

allNullOrNotNegativeInteger()

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

iterable<non-negative-int|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>|null

allNullOrNotOneOf()

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

allNullOrNotRegex()

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

allNullOrNotSame()

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

allNullOrNotStartsWith()

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

allNullOrNotStatic()

public static allNullOrNotStatic(iterable<string|int, Closure|callable|null> $callable[, string $message = '' ]) : iterable<string|int, callable|null>
Parameters
$callable : iterable<string|int, Closure|callable|null>
$message : string = ''
Tags
psalm-assert

iterable<callable|null> $callable

throws
InvalidArgumentException
Return values
iterable<string|int, callable|null>

allNullOrNotWhitespaceOnly()

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

allNullOrNumeric()

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

iterable<numeric|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, (numeric)|null>

allNullOrObject()

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

iterable<object|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, object|null>

allNullOrObjectish()

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

iterable<object|string|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, object|string|null>

allNullOrOneOf()

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

allNullOrPositiveInteger()

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

iterable<positive-int|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, positive-int|null>

allNullOrPropertyExists()

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

allNullOrPropertyNotExists()

public static allNullOrPropertyNotExists(iterable<string|int, string|object|null> $classOrObject, mixed $property[, string $message = '' ]) : mixed
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(iterable<string|int, mixed>|null $value, mixed $min, mixed $max[, string $message = '' ]) : mixed
Parameters
$value : iterable<string|int, mixed>|null
$min : mixed
$max : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allNullOrReadable()

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

allNullOrRegex()

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

allNullOrResource()

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

iterable<resource|null> $value

see
https://www.php.net/manual/en/function.get-resource-type.php
throws
InvalidArgumentException
Return values
iterable<string|int, resource|null>

allNullOrSame()

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

allNullOrScalar()

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

iterable<scalar|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, scalar|null>

allNullOrStartsWith()

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

allNullOrStartsWithLetter()

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

allNullOrString()

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

iterable<string|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, string|null>

allNullOrStringNotEmpty()

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

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

throws
InvalidArgumentException
Return values
iterable<string|int, non-empty-string|null>

allNullOrSubclassOf()

public static allNullOrSubclassOf(iterable<string|int, mixed>|null $value, ExpectedType> $class[, string $message = '' ]) : iterable<string|int, ExpectedType>|null>
Parameters
$value : iterable<string|int, mixed>|null
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

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

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType>|null>

allNullOrThrows()

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

class-string<Throwable> $class

throws
InvalidArgumentException

allNullOrTrue()

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

iterable<true|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, true|null>

allNullOrUnicodeLetters()

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

allNullOrUniqueValues()

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

allNullOrUpper()

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

iterable $value

@return

iterable

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>|null

allNullOrUuid()

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

allNullOrValidArrayKey()

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

iterable<array-key|null> $value

throws
InvalidArgumentException
Return values
iterable<string|int, (array-key)|null>

allNullOrWritable()

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

allNumeric()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, numeric-string|int|float>

allObject()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, object>

allObjectish()

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

iterable<object|string> $value

throws
InvalidArgumentException
Return values
iterable<string|int, object|string>

allOneOf()

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

allPositiveInteger()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, positive-int>

allPropertyExists()

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

allPropertyNotExists()

public static allPropertyNotExists(iterable<string|int, string|object> $classOrObject, mixed $property[, string $message = '' ]) : mixed
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(iterable<string|int, mixed> $value, mixed $min, mixed $max[, string $message = '' ]) : mixed
Parameters
$value : iterable<string|int, mixed>
$min : mixed
$max : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

allReadable()

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

allRegex()

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

allResource()

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

iterable $value

see
https://www.php.net/manual/en/function.get-resource-type.php
throws
InvalidArgumentException
Return values
iterable<string|int, resource>

allSame()

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

allScalar()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, scalar>

allStartsWith()

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

allStartsWithLetter()

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

allString()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, string>

allStringNotEmpty()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, non-empty-string>

allSubclassOf()

public static allSubclassOf(iterable<string|int, mixed> $value, ExpectedType> $class[, string $message = '' ]) : iterable<string|int, ExpectedType>>
Parameters
$value : iterable<string|int, mixed>
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

iterable<class-string<ExpectedType>> $value

throws
InvalidArgumentException
Return values
iterable<string|int, ExpectedType>>

allThrows()

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

class-string<Throwable> $class

throws
InvalidArgumentException

allTrue()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, true>

allUnicodeLetters()

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

allUniqueValues()

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

allUpper()

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

allUuid()

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

allValidArrayKey()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, string|int>

allWritable()

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

alnum()

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

alpha()

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

boolean()

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

bool $value

throws
InvalidArgumentException
Return values
bool

classExists()

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

class-string $value

throws
InvalidArgumentException
Return values
string

contains()

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

count()

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

countBetween()

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

digits()

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

directory()

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

email()

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

string $value

throws
InvalidArgumentException
Return values
string

endsWith()

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

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 = '' ]) : false
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

false $value

throws
InvalidArgumentException
Return values
false

file()

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

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 = '' ]) : string
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException
Return values
string

float()

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

float $value

throws
InvalidArgumentException
Return values
float

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(ExpectedType>|ExpectedType $value, ExpectedType> $interface[, string $message = '' ]) : object|string
Parameters
$value : ExpectedType>|ExpectedType
$interface : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

class-string<ExpectedType>|ExpectedType $value

throws
InvalidArgumentException
Return values
object|string

inArray()

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

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

integer()

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

int $value

throws
InvalidArgumentException
Return values
int

integerish()

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

numeric $value

throws
InvalidArgumentException
Return values
int|float|string

interfaceExists()

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

class-string $value

throws
InvalidArgumentException
Return values
string

ip()

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

string $value

throws
InvalidArgumentException
Return values
string

ipv4()

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

string $value

throws
InvalidArgumentException
Return values
string

ipv6()

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

string $value

throws
InvalidArgumentException
Return values
string

isAnyOf()

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

array $classes

throws
InvalidArgumentException
Return values
object|string

isAOf()

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

ExpectedType|class-string<ExpectedType> $value

throws
InvalidArgumentException
Return values
ExpectedType|ExpectedType>

isArray()

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

array $value

throws
InvalidArgumentException
Return values
array<string|int, mixed>

isArrayAccessible()

public static isArrayAccessible(mixed $value[, string $message = '' ]) : array<string|int, mixed>|ArrayAccess
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array|ArrayAccess $value

throws
InvalidArgumentException
Return values
array<string|int, mixed>|ArrayAccess

isCallable()

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

callable $value

throws
InvalidArgumentException
Return values
callable

isCountable()

public static isCountable(mixed $value[, string $message = '' ]) : array<string|int, mixed>|Countable
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

countable $value

throws
InvalidArgumentException
Return values
array<string|int, mixed>|Countable

isEmpty()

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

empty $value

psalm-return

empty

throws
InvalidArgumentException

isInitialized()

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

object $value

throws
InvalidArgumentException
Return values
object

isInstanceOf()

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

ExpectedType $value

throws
InvalidArgumentException
Return values
ExpectedType

isInstanceOfAny()

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

array $classes

throws
InvalidArgumentException
Return values
object

isIterable()

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

iterable $value

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>

isList()

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

list $array

psalm-return

list

throws
InvalidArgumentException
Return values
array<string|int, mixed>

isMap()

public static isMap(mixed|array<string|int, T$array[, string $message = '' ]) : array<string, T>
Parameters
$array : mixed|array<string|int, T>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

array<string, T> $array

throws
InvalidArgumentException
Return values
array<string, T>

isNonEmptyList()

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

non-empty-list $array

psalm-return

non-empty-list

throws
InvalidArgumentException
Return values
array<string|int, mixed>

isNonEmptyMap()

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

array<string, T> $array

psalm-assert

!empty $array

throws
InvalidArgumentException
Return values
array<string, T>

isNotA()

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

!UnexpectedType

throws
InvalidArgumentException
Return values
object|string

isStatic()

public static isStatic(Closure|callable $callable[, string $message = '' ]) : Closure|callable-string
Parameters
$callable : Closure|callable
$message : string = ''
Tags
psalm-assert

callable $callable

throws
InvalidArgumentException
Return values
Closure|callable-string

keyExists()

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

keyNotExists()

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

length()

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

lengthBetween()

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

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

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(mixed $value[, string $message = '' ]) : string
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

lowercase-string $value

throws
InvalidArgumentException
Return values
string

maxCount()

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

maxLength()

Inclusive max.

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

methodExists()

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

class-string|object $classOrObject

throws
InvalidArgumentException
Return values
object|string

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()

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

minLength()

Inclusive min.

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

natural()

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

positive-int|0 $value

psalm-return

positive-int|0

throws
InvalidArgumentException
Return values
int

negativeInteger()

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

negative-int $value

psalm-return

negative-int

throws
InvalidArgumentException
Return values
int

notContains()

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

notEmpty()

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

!empty $value

psalm-return

!empty

throws
InvalidArgumentException

notEndsWith()

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

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

notInArray()

Check that a value is not present

public static notInArray(mixed $value, mixed $values[, string $message = '' ]) : mixed

Does strict comparison, so Assert::notInArray(3, [1, 2, 3]) will not pass the assertion, but Assert::notInArray(3, ['3']) will.

Parameters
$value : mixed
$values : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

notInstanceOf()

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

!ExpectedType $value

@return

!ExpectedType

throws
InvalidArgumentException
Return values
object

notNegativeInteger()

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

non-negative-int $value

psalm-return

non-negative-int

throws
InvalidArgumentException
Return values
int

notNull()

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

!null $value

psalm-return

!null

throws
InvalidArgumentException

notOneOf()

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

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

notRegex()

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

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(mixed $value, mixed $prefix[, string $message = '' ]) : string
Parameters
$value : mixed
$prefix : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException
Return values
string

notStatic()

public static notStatic(Closure|callable $callable[, string $message = '' ]) : Closure|callable-string
Parameters
$callable : Closure|callable
$message : string = ''
Tags
psalm-assert

callable $callable

throws
InvalidArgumentException
Return values
Closure|callable-string

notWhitespaceOnly()

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

null()

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

null $value

throws
InvalidArgumentException
Return values
null

nullOrAlnum()

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

nullOrAlpha()

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

nullOrBoolean()

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

bool|null $value

throws
InvalidArgumentException
Return values
bool|null

nullOrClassExists()

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

class-string|null $value

throws
InvalidArgumentException
Return values
class-string|null

nullOrContains()

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

nullOrCount()

public static nullOrCount(mixed $array, mixed $number[, string $message = '' ]) : mixed
Parameters
$array : mixed
$number : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrCountBetween()

public static nullOrCountBetween(mixed $array, mixed $min, mixed $max[, string $message = '' ]) : mixed
Parameters
$array : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrDigits()

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

nullOrDirectory()

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

nullOrEmail()

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

string|null $value

throws
InvalidArgumentException

nullOrEndsWith()

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

nullOrEq()

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

nullOrFalse()

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

false|null $value

throws
InvalidArgumentException
Return values
false|null

nullOrFile()

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

nullOrFileExists()

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

nullOrFloat()

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

float|null $value

throws
InvalidArgumentException
Return values
float|null

nullOrGreaterThan()

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

nullOrGreaterThanEq()

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

nullOrImplementsInterface()

public static nullOrImplementsInterface(ExpectedType>|ExpectedType|null $value, ExpectedType> $interface[, string $message = '' ]) : ExpectedType>|ExpectedType|null
Parameters
$value : ExpectedType>|ExpectedType|null
$interface : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

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

throws
InvalidArgumentException
Return values
ExpectedType>|ExpectedType|null

nullOrInArray()

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

nullOrInteger()

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

int|null $value

throws
InvalidArgumentException
Return values
int|null

nullOrIntegerish()

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

numeric|null $value

throws
InvalidArgumentException
Return values
(numeric)|null

nullOrInterfaceExists()

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

class-string|null $value

throws
InvalidArgumentException
Return values
class-string|null

nullOrIp()

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

string|null $value

throws
InvalidArgumentException

nullOrIpv4()

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

string|null $value

throws
InvalidArgumentException

nullOrIpv6()

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

string|null $value

throws
InvalidArgumentException

nullOrIsAnyOf()

public static nullOrIsAnyOf(object|string|null $value, array<string|int, string> $classes[, string $message = '' ]) : mixed
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(ExpectedType|ExpectedType>|null $value, ExpectedType> $class[, string $message = '' ]) : ExpectedType|ExpectedType>|null
Parameters
$value : ExpectedType|ExpectedType>|null
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
psalm-assert

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

throws
InvalidArgumentException
Return values
ExpectedType|ExpectedType>|null

nullOrIsArray()

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

array|null $value

throws
InvalidArgumentException
Return values
array<string|int, mixed>|null

nullOrIsArrayAccessible()

public static nullOrIsArrayAccessible(mixed $value[, string $message = '' ]) : array<string|int, mixed>|ArrayAccess|null
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

array|ArrayAccess|null $value

throws
InvalidArgumentException
Return values
array<string|int, mixed>|ArrayAccess|null

nullOrIsCallable()

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

callable|null $value

throws
InvalidArgumentException
Return values
callable|null

nullOrIsCountable()

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

countable|null $value

throws
InvalidArgumentException
Return values
countable|null

nullOrIsEmpty()

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

empty $value

throws
InvalidArgumentException
Return values
empty

nullOrIsInstanceOf()

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

ExpectedType|null $value

throws
InvalidArgumentException
Return values
ExpectedType|null

nullOrIsInstanceOfAny()

public static nullOrIsInstanceOfAny(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

nullOrIsIterable()

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

iterable|null $value

throws
InvalidArgumentException
Return values
iterable<string|int, mixed>|null

nullOrIsList()

public static nullOrIsList(mixed $array[, string $message = '' ]) : array<int, mixed>|null
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

list|null $array

throws
InvalidArgumentException
Return values
array<int, mixed>|null

nullOrIsMap()

public static nullOrIsMap(mixed|array<string|int, T>|null $array[, string $message = '' ]) : array<string, T>|null
Parameters
$array : mixed|array<string|int, T>|null
$message : string = ''
Tags
psalm-pure
template
psalm-assert

array<string, T>|null $array

throws
InvalidArgumentException
Return values
array<string, T>|null

nullOrIsNonEmptyList()

public static nullOrIsNonEmptyList(mixed $array[, string $message = '' ]) : array<int, mixed>|null
Parameters
$array : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

non-empty-list|null $array

throws
InvalidArgumentException
Return values
array<int, mixed>|null

nullOrIsNonEmptyMap()

public static nullOrIsNonEmptyMap(array<string, T>|null $array[, string $message = '' ]) : mixed
Parameters
$array : array<string, T>|null
$message : string = ''
Tags
psalm-pure
template
throws
InvalidArgumentException

nullOrIsNotA()

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

nullOrIsStatic()

public static nullOrIsStatic(Closure|callable|null $callable[, string $message = '' ]) : callable|null
Parameters
$callable : Closure|callable|null
$message : string = ''
Tags
psalm-assert

callable|null $callable

throws
InvalidArgumentException
Return values
callable|null

nullOrKeyExists()

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

nullOrKeyNotExists()

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

nullOrLength()

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

nullOrLengthBetween()

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

nullOrLessThan()

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

nullOrLessThanEq()

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

nullOrLower()

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

lowercase-string|null $value

throws
InvalidArgumentException
Return values
lowercase-string|null

nullOrMaxCount()

public static nullOrMaxCount(mixed $array, mixed $max[, string $message = '' ]) : mixed
Parameters
$array : mixed
$max : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrMaxLength()

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

nullOrMethodExists()

public static nullOrMethodExists(string|object|null $classOrObject, mixed $method[, string $message = '' ]) : mixed
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 = '' ]) : mixed
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(mixed $array, mixed $min[, string $message = '' ]) : mixed
Parameters
$array : mixed
$min : mixed
$message : string = ''
Tags
throws
InvalidArgumentException

nullOrMinLength()

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

nullOrNatural()

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

positive-int|0|null $value

throws
InvalidArgumentException
Return values
positive-int|0|null

nullOrNegativeInteger()

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

negative-int|null $value

throws
InvalidArgumentException
Return values
negative-int|null

nullOrNotContains()

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

nullOrNotEmpty()

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

nullOrNotEndsWith()

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

nullOrNotEq()

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

nullOrNotFalse()

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

nullOrNotInArray()

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

nullOrNotInstanceOf()

public static nullOrNotInstanceOf(mixed $value, ExpectedType> $class[, string $message = '' ]) : mixed
Parameters
$value : mixed
$class : ExpectedType>
$message : string = ''
Tags
psalm-pure
template
throws
InvalidArgumentException

nullOrNotNegativeInteger()

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

non-negative-int|null $value

throws
InvalidArgumentException

nullOrNotOneOf()

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

nullOrNotRegex()

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

nullOrNotSame()

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

nullOrNotStartsWith()

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

nullOrNotStatic()

public static nullOrNotStatic(Closure|callable|null $callable[, string $message = '' ]) : callable|null
Parameters
$callable : Closure|callable|null
$message : string = ''
Tags
psalm-assert

callable|null $callable

throws
InvalidArgumentException
Return values
callable|null

nullOrNotWhitespaceOnly()

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

nullOrNumeric()

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

numeric|null $value

throws
InvalidArgumentException
Return values
(numeric)|null

nullOrObject()

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

object|null $value

throws
InvalidArgumentException
Return values
object|null

nullOrObjectish()

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

object|string|null $value

throws
InvalidArgumentException
Return values
object|string|null

nullOrOneOf()

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

nullOrPositiveInteger()

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

positive-int|null $value

throws
InvalidArgumentException
Return values
positive-int|null

nullOrPropertyExists()

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

nullOrPropertyNotExists()

public static nullOrPropertyNotExists(string|object|null $classOrObject, mixed $property[, string $message = '' ]) : mixed
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 = '' ]) : mixed
Parameters
$value : mixed
$min : mixed
$max : mixed
$message : string = ''
Tags
psalm-pure
throws
InvalidArgumentException

nullOrReadable()

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

nullOrRegex()

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

nullOrSame()

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

nullOrScalar()

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

scalar|null $value

throws
InvalidArgumentException
Return values
scalar|null

nullOrStartsWith()

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

nullOrStartsWithLetter()

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

nullOrString()

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

string|null $value

throws
InvalidArgumentException
Return values
string|null

nullOrStringNotEmpty()

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

non-empty-string|null $value

throws
InvalidArgumentException
Return values
non-empty-string|null

nullOrSubclassOf()

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

class-string<ExpectedType>|null $value

throws
InvalidArgumentException
Return values
ExpectedType>|null

nullOrThrows()

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

class-string<Throwable> $class

throws
InvalidArgumentException

nullOrTrue()

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

true|null $value

throws
InvalidArgumentException
Return values
true|null

nullOrUnicodeLetters()

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

nullOrUniqueValues()

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

nullOrUpper()

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

nullOrUuid()

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

nullOrValidArrayKey()

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

array-key|null $value

throws
InvalidArgumentException
Return values
(array-key)|null

nullOrWritable()

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

numeric()

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

numeric $value

throws
InvalidArgumentException
Return values
int|float|string

object()

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

object $value

throws
InvalidArgumentException
Return values
object

objectish()

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

object|string $value

psalm-return

object|string

throws
InvalidArgumentException
Return values
object|string

oneOf()

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

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

positiveInteger()

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

positive-int $value

psalm-return

positive-int

throws
InvalidArgumentException
Return values
int

propertyExists()

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

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(mixed $value[, string $message = '' ]) : string
Parameters
$value : mixed
$message : string = ''
Tags
throws
InvalidArgumentException
Return values
string

regex()

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

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 = '' ]) : int|bool|float|string
Parameters
$value : mixed
$message : string = ''
Tags
psalm-pure
psalm-assert

scalar $value

throws
InvalidArgumentException
Return values
int|bool|float|string

startsWith()

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

startsWithLetter()

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

string()

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

string $value

throws
InvalidArgumentException
Return values
string

stringNotEmpty()

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

non-empty-string $value

psalm-return

non-empty-string

throws
InvalidArgumentException
Return values
string

subclassOf()

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

class-string<ExpectedType> $value

throws
InvalidArgumentException
Return values
ExpectedType>

throws()

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

class-string<Throwable> $class

throws
InvalidArgumentException
Return values
callable

true()

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

true $value

throws
InvalidArgumentException
Return values
true

unicodeLetters()

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

uniqueValues()

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

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

upper()

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

!lowercase-string $value

throws
InvalidArgumentException
Return values
string

uuid()

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

validArrayKey()

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

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

array-key $value

throws
InvalidArgumentException
Return values
string|int

writable()

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

callableToClosure()

protected static callableToClosure(callable $callable) : Closure|callable-string
Parameters
$callable : callable
Tags
psalm-pure
Return values
Closure|callable-string

reportInvalidArgument()

protected static reportInvalidArgument(string $message) : never
Parameters
$message : string
Tags
psalm-pure

this method is not supposed to perform side effects

throws
InvalidArgumentException
Return values
never

strlen()

protected static strlen(string $value) : int
Parameters
$value : string
Return values
int

typeToString()

protected static typeToString(mixed $value) : string
Parameters
$value : mixed
Tags
psalm-pure
Return values
string

valueToString()

protected static valueToString(mixed $value) : string
Parameters
$value : mixed
Tags
psalm-pure
Return values
string

__construct()

private __construct() : mixed

        
On this page

Search results