Copied!

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

Cloneable
Methods
public static __callStatic( $name, $arguments)
public static allAlnum( $value, $message = '')
public static allAlpha( $value, $message = '')
public static allBoolean( $value, $message = '')
public static allClassExists( $value, $message = '')
public static allContains( $value, $subString, $message = '')
public static allCount( $array, $number, $message = '')
public static allCountBetween( $array, $min, $max, $message = '')
public static allDigits( $value, $message = '')
public static allDirectory( $value, $message = '')
public static allEmail( $value, $message = '')
public static allEndsWith( $value, $suffix, $message = '')
public static allEq( $value, $expect, $message = '')
public static allFalse( $value, $message = '')
public static allFile( $value, $message = '')
public static allFileExists( $value, $message = '')
public static allFloat( $value, $message = '')
public static allGreaterThan( $value, $limit, $message = '')
public static allGreaterThanEq( $value, $limit, $message = '')
public static allImplementsInterface( $value, $interface, $message = '')
 
public static allInArray( $value, $values, $message = '')
public static allInteger( $value, $message = '')
public static allIntegerish( $value, $message = '')
public static allInterfaceExists( $value, $message = '')
public static allIp( $value, $message = '')
public static allIpv4( $value, $message = '')
public static allIpv6( $value, $message = '')
public static allIsAnyOf( $value, $classes, $message = '')
public static allIsAOf( $value, $class, $message = '')
 
public static allIsArray( $value, $message = '')
public static allIsArrayAccessible( $value, $message = '')
 
public static allIsCallable( $value, $message = '')
public static allIsCountable( $value, $message = '')
public static allIsEmpty( $value, $message = '')
public static allIsInstanceOf( $value, $class, $message = '')
 
public static allIsInstanceOfAny( $value, $classes, $message = '')
public static allIsIterable( $value, $message = '')
public static allIsList( $array, $message = '')
public static allIsMap( $array, $message = '')
 
public static allIsNonEmptyList( $array, $message = '')
 
public static allIsNonEmptyMap( $array, $message = '')
 
public static allIsNotA( $value, $class, $message = '')
 
public static allIsTraversable( $value, $message = '')
 
public static allKeyExists( $array, $key, $message = '')
public static allKeyNotExists( $array, $key, $message = '')
public static allLength( $value, $length, $message = '')
public static allLengthBetween( $value, $min, $max, $message = '')
public static allLessThan( $value, $limit, $message = '')
public static allLessThanEq( $value, $limit, $message = '')
public static allLower( $value, $message = '')
 
public static allMaxCount( $array, $max, $message = '')
public static allMaxLength( $value, $max, $message = '')
public static allMethodExists( $classOrObject, $method, $message = '')
 
public static allMethodNotExists( $classOrObject, $method, $message = '')
 
public static allMinCount( $array, $min, $message = '')
public static allMinLength( $value, $min, $message = '')
public static allNatural( $value, $message = '')
 
public static allNotContains( $value, $subString, $message = '')
public static allNotEmpty( $value, $message = '')
public static allNotEndsWith( $value, $suffix, $message = '')
public static allNotEq( $value, $expect, $message = '')
public static allNotFalse( $value, $message = '')
public static allNotInstanceOf( $value, $class, $message = '')
 
public static allNotNull( $value, $message = '')
public static allNotRegex( $value, $pattern, $message = '')
public static allNotSame( $value, $expect, $message = '')
public static allNotStartsWith( $value, $prefix, $message = '')
public static allNotWhitespaceOnly( $value, $message = '')
public static allNull( $value, $message = '')
public static allNullOrAlnum( $value, $message = '')
public static allNullOrAlpha( $value, $message = '')
public static allNullOrBoolean( $value, $message = '')
public static allNullOrClassExists( $value, $message = '')
public static allNullOrContains( $value, $subString, $message = '')
public static allNullOrCount( $array, $number, $message = '')
public static allNullOrCountBetween( $array, $min, $max, $message = '')
public static allNullOrDigits( $value, $message = '')
public static allNullOrDirectory( $value, $message = '')
public static allNullOrEmail( $value, $message = '')
public static allNullOrEndsWith( $value, $suffix, $message = '')
public static allNullOrEq( $value, $expect, $message = '')
public static allNullOrFalse( $value, $message = '')
public static allNullOrFile( $value, $message = '')
public static allNullOrFileExists( $value, $message = '')
public static allNullOrFloat( $value, $message = '')
public static allNullOrGreaterThan( $value, $limit, $message = '')
public static allNullOrGreaterThanEq( $value, $limit, $message = '')
public static allNullOrImplementsInterface( $value, $interface, $message = '')
 
public static allNullOrInArray( $value, $values, $message = '')
public static allNullOrInteger( $value, $message = '')
public static allNullOrIntegerish( $value, $message = '')
 
public static allNullOrInterfaceExists( $value, $message = '')
public static allNullOrIp( $value, $message = '')
public static allNullOrIpv4( $value, $message = '')
public static allNullOrIpv6( $value, $message = '')
public static allNullOrIsAnyOf( $value, $classes, $message = '')
public static allNullOrIsAOf( $value, $class, $message = '')
 
public static allNullOrIsArray( $value, $message = '')
public static allNullOrIsArrayAccessible( $value, $message = '')
 
public static allNullOrIsCallable( $value, $message = '')
 
public static allNullOrIsCountable( $value, $message = '')
 
public static allNullOrIsEmpty( $value, $message = '')
public static allNullOrIsInstanceOf( $value, $class, $message = '')
 
public static allNullOrIsInstanceOfAny( $value, $classes, $message = '')
public static allNullOrIsIterable( $value, $message = '')
 
public static allNullOrIsList( $array, $message = '')
public static allNullOrIsMap( $array, $message = '')
 
public static allNullOrIsNonEmptyList( $array, $message = '')
 
public static allNullOrIsNonEmptyMap( $array, $message = '')
 
public static allNullOrIsNotA( $value, $class, $message = '')
 
public static allNullOrIsTraversable( $value, $message = '')
 
public static allNullOrKeyExists( $array, $key, $message = '')
public static allNullOrKeyNotExists( $array, $key, $message = '')
public static allNullOrLength( $value, $length, $message = '')
public static allNullOrLengthBetween( $value, $min, $max, $message = '')
public static allNullOrLessThan( $value, $limit, $message = '')
public static allNullOrLessThanEq( $value, $limit, $message = '')
public static allNullOrLower( $value, $message = '')
 
public static allNullOrMaxCount( $array, $max, $message = '')
public static allNullOrMaxLength( $value, $max, $message = '')
public static allNullOrMethodExists( $classOrObject, $method, $message = '')
 
public static allNullOrMethodNotExists( $classOrObject, $method, $message = '')
 
public static allNullOrMinCount( $array, $min, $message = '')
public static allNullOrMinLength( $value, $min, $message = '')
public static allNullOrNatural( $value, $message = '')
 
public static allNullOrNotContains( $value, $subString, $message = '')
public static allNullOrNotEmpty( $value, $message = '')
 
public static allNullOrNotEndsWith( $value, $suffix, $message = '')
public static allNullOrNotEq( $value, $expect, $message = '')
public static allNullOrNotFalse( $value, $message = '')
 
public static allNullOrNotInstanceOf( $value, $class, $message = '')
 
public static allNullOrNotRegex( $value, $pattern, $message = '')
public static allNullOrNotSame( $value, $expect, $message = '')
public static allNullOrNotStartsWith( $value, $prefix, $message = '')
public static allNullOrNotWhitespaceOnly( $value, $message = '')
public static allNullOrNumeric( $value, $message = '')
 
public static allNullOrObject( $value, $message = '')
 
public static allNullOrOneOf( $value, $values, $message = '')
public static allNullOrPositiveInteger( $value, $message = '')
 
public static allNullOrPropertyExists( $classOrObject, $property, $message = '')
 
public static allNullOrPropertyNotExists( $classOrObject, $property, $message = '')
 
public static allNullOrRange( $value, $min, $max, $message = '')
public static allNullOrReadable( $value, $message = '')
public static allNullOrRegex( $value, $pattern, $message = '')
public static allNullOrResource( $value, $type = NULL, $message = '')
public static allNullOrSame( $value, $expect, $message = '')
public static allNullOrScalar( $value, $message = '')
 
public static allNullOrStartsWith( $value, $prefix, $message = '')
public static allNullOrStartsWithLetter( $value, $message = '')
public static allNullOrString( $value, $message = '')
 
public static allNullOrStringNotEmpty( $value, $message = '')
 
public static allNullOrSubclassOf( $value, $class, $message = '')
 
public static allNullOrThrows( $expression, $class = 'Exception', $message = '')
public static allNullOrTrue( $value, $message = '')
public static allNullOrUnicodeLetters( $value, $message = '')
public static allNullOrUniqueValues( $values, $message = '')
public static allNullOrUpper( $value, $message = '')
 
public static allNullOrUuid( $value, $message = '')
public static allNullOrValidArrayKey( $value, $message = '')
 
public static allNullOrWritable( $value, $message = '')
public static allNumeric( $value, $message = '')
public static allObject( $value, $message = '')
public static allOneOf( $value, $values, $message = '')
public static allPositiveInteger( $value, $message = '')
 
public static allPropertyExists( $classOrObject, $property, $message = '')
 
public static allPropertyNotExists( $classOrObject, $property, $message = '')
 
public static allRange( $value, $min, $max, $message = '')
public static allReadable( $value, $message = '')
public static allRegex( $value, $pattern, $message = '')
public static allResource( $value, $type = NULL, $message = '')
public static allSame( $value, $expect, $message = '')
public static allScalar( $value, $message = '')
public static allStartsWith( $value, $prefix, $message = '')
public static allStartsWithLetter( $value, $message = '')
public static allString( $value, $message = '')
public static allStringNotEmpty( $value, $message = '')
 
public static allSubclassOf( $value, $class, $message = '')
 
public static allThrows( $expression, $class = 'Exception', $message = '')
public static allTrue( $value, $message = '')
public static allUnicodeLetters( $value, $message = '')
public static allUniqueValues( $values, $message = '')
public static allUpper( $value, $message = '')
public static allUuid( $value, $message = '')
public static allValidArrayKey( $value, $message = '')
public static allWritable( $value, $message = '')
public static alnum( $value, $message = '')
public static alpha( $value, $message = '')
public static boolean( $value, $message = '')
public static classExists( $value, $message = '')
public static contains( $value, $subString, $message = '')
public static count( $array, $number, $message = '')
 

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

public static countBetween( $array, $min, $max, $message = '')
 

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

public static digits( $value, $message = '')
public static directory( $value, $message = '')
public static email( $value, $message = '')
public static endsWith( $value, $suffix, $message = '')
public static eq( $value, $expect, $message = '')
public static false( $value, $message = '')
 
public static file( $value, $message = '')
public static fileExists( $value, $message = '')
 

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

public static float( $value, $message = '')
 
public static greaterThan( $value, $limit, $message = '')
public static greaterThanEq( $value, $limit, $message = '')
public static implementsInterface( $value, $interface, $message = '')
 
public static inArray( $value, array $values, $message = '')
 

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

public static integer( $value, $message = '')
public static integerish( $value, $message = '')
 
public static interfaceExists( $value, $message = '')
public static ip( $value, $message = '')
public static ipv4( $value, $message = '')
public static ipv6( $value, $message = '')
public static isAnyOf( $value, array $classes, $message = '')
 
public static isAOf( $value, $class, $message = '')
 
public static isArray( $value, $message = '')
 
public static isArrayAccessible( $value, $message = '')
 
public static isCallable( $value, $message = '')
 
public static isCountable( $value, $message = '')
 
public static isEmpty( $value, $message = '')
 
public static isInstanceOf( $value, $class, $message = '')
 
public static isInstanceOfAny( $value, array $classes, $message = '')
 
public static isIterable( $value, $message = '')
 
public static isList( $array, $message = '')
public static isMap( $array, $message = '')
 
public static isNonEmptyList( $array, $message = '')
 
public static isNonEmptyMap( $array, $message = '')
 
public static isNotA( $value, $class, $message = '')
 
public static isTraversable( $value, $message = '')
 
public static keyExists( $array, $key, $message = '')
public static keyNotExists( $array, $key, $message = '')
public static length( $value, $length, $message = '')
public static lengthBetween( $value, $min, $max, $message = '')
 

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

public static lessThan( $value, $limit, $message = '')
public static lessThanEq( $value, $limit, $message = '')
public static lower( $value, $message = '')
 
public static maxCount( $array, $max, $message = '')
 

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

public static maxLength( $value, $max, $message = '')
public static methodExists( $classOrObject, $method, $message = '')
 
public static methodNotExists( $classOrObject, $method, $message = '')
 
public static minCount( $array, $min, $message = '')
 

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

public static minLength( $value, $min, $message = '')
public static natural( $value, $message = '')
 
public static notContains( $value, $subString, $message = '')
public static notEmpty( $value, $message = '')
 
public static notEndsWith( $value, $suffix, $message = '')
public static notEq( $value, $expect, $message = '')
public static notFalse( $value, $message = '')
 
public static notInstanceOf( $value, $class, $message = '')
 
public static notNull( $value, $message = '')
 
public static notRegex( $value, $pattern, $message = '')
public static notSame( $value, $expect, $message = '')
public static notStartsWith( $value, $prefix, $message = '')
public static notWhitespaceOnly( $value, $message = '')
public static null( $value, $message = '')
public static nullOrAlnum( $value, $message = '')
public static nullOrAlpha( $value, $message = '')
public static nullOrBoolean( $value, $message = '')
public static nullOrClassExists( $value, $message = '')
public static nullOrContains( $value, $subString, $message = '')
public static nullOrCount( $array, $number, $message = '')
public static nullOrCountBetween( $array, $min, $max, $message = '')
public static nullOrDigits( $value, $message = '')
public static nullOrDirectory( $value, $message = '')
public static nullOrEmail( $value, $message = '')
public static nullOrEndsWith( $value, $suffix, $message = '')
public static nullOrEq( $value, $expect, $message = '')
public static nullOrFalse( $value, $message = '')
public static nullOrFile( $value, $message = '')
public static nullOrFileExists( $value, $message = '')
public static nullOrFloat( $value, $message = '')
public static nullOrGreaterThan( $value, $limit, $message = '')
public static nullOrGreaterThanEq( $value, $limit, $message = '')
public static nullOrImplementsInterface( $value, $interface, $message = '')
 
public static nullOrInArray( $value, $values, $message = '')
public static nullOrInteger( $value, $message = '')
public static nullOrIntegerish( $value, $message = '')
public static nullOrInterfaceExists( $value, $message = '')
public static nullOrIp( $value, $message = '')
public static nullOrIpv4( $value, $message = '')
public static nullOrIpv6( $value, $message = '')
public static nullOrIsAnyOf( $value, $classes, $message = '')
public static nullOrIsAOf( $value, $class, $message = '')
 
public static nullOrIsArray( $value, $message = '')
public static nullOrIsArrayAccessible( $value, $message = '')
 
public static nullOrIsCallable( $value, $message = '')
public static nullOrIsCountable( $value, $message = '')
public static nullOrIsEmpty( $value, $message = '')
public static nullOrIsInstanceOf( $value, $class, $message = '')
 
public static nullOrIsInstanceOfAny( $value, $classes, $message = '')
public static nullOrIsIterable( $value, $message = '')
public static nullOrIsList( $array, $message = '')
public static nullOrIsMap( $array, $message = '')
 
public static nullOrIsNonEmptyList( $array, $message = '')
public static nullOrIsNonEmptyMap( $array, $message = '')
 
public static nullOrIsNotA( $value, $class, $message = '')
 
public static nullOrIsTraversable( $value, $message = '')
 
public static nullOrKeyExists( $array, $key, $message = '')
public static nullOrKeyNotExists( $array, $key, $message = '')
public static nullOrLength( $value, $length, $message = '')
public static nullOrLengthBetween( $value, $min, $max, $message = '')
public static nullOrLessThan( $value, $limit, $message = '')
public static nullOrLessThanEq( $value, $limit, $message = '')
public static nullOrLower( $value, $message = '')
public static nullOrMaxCount( $array, $max, $message = '')
public static nullOrMaxLength( $value, $max, $message = '')
public static nullOrMethodExists( $classOrObject, $method, $message = '')
 
public static nullOrMethodNotExists( $classOrObject, $method, $message = '')
 
public static nullOrMinCount( $array, $min, $message = '')
public static nullOrMinLength( $value, $min, $message = '')
public static nullOrNatural( $value, $message = '')
public static nullOrNotContains( $value, $subString, $message = '')
public static nullOrNotEmpty( $value, $message = '')
public static nullOrNotEndsWith( $value, $suffix, $message = '')
public static nullOrNotEq( $value, $expect, $message = '')
public static nullOrNotFalse( $value, $message = '')
public static nullOrNotInstanceOf( $value, $class, $message = '')
 
public static nullOrNotRegex( $value, $pattern, $message = '')
public static nullOrNotSame( $value, $expect, $message = '')
public static nullOrNotStartsWith( $value, $prefix, $message = '')
public static nullOrNotWhitespaceOnly( $value, $message = '')
public static nullOrNumeric( $value, $message = '')
public static nullOrObject( $value, $message = '')
public static nullOrOneOf( $value, $values, $message = '')
public static nullOrPositiveInteger( $value, $message = '')
public static nullOrPropertyExists( $classOrObject, $property, $message = '')
 
public static nullOrPropertyNotExists( $classOrObject, $property, $message = '')
 
public static nullOrRange( $value, $min, $max, $message = '')
public static nullOrReadable( $value, $message = '')
public static nullOrRegex( $value, $pattern, $message = '')
public static nullOrResource( $value, $type = NULL, $message = '')
public static nullOrSame( $value, $expect, $message = '')
public static nullOrScalar( $value, $message = '')
public static nullOrStartsWith( $value, $prefix, $message = '')
public static nullOrStartsWithLetter( $value, $message = '')
public static nullOrString( $value, $message = '')
public static nullOrStringNotEmpty( $value, $message = '')
 
public static nullOrSubclassOf( $value, $class, $message = '')
 
public static nullOrThrows( $expression, $class = 'Exception', $message = '')
public static nullOrTrue( $value, $message = '')
public static nullOrUnicodeLetters( $value, $message = '')
public static nullOrUniqueValues( $values, $message = '')
public static nullOrUpper( $value, $message = '')
public static nullOrUuid( $value, $message = '')
public static nullOrValidArrayKey( $value, $message = '')
public static nullOrWritable( $value, $message = '')
public static numeric( $value, $message = '')
 
public static object( $value, $message = '')
 
public static oneOf( $value, array $values, $message = '')
 

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

public static positiveInteger( $value, $message = '')
 
public static propertyExists( $classOrObject, $property, $message = '')
 
public static propertyNotExists( $classOrObject, $property, $message = '')
 
public static range( $value, $min, $max, $message = '')
public static readable( $value, $message = '')
public static regex( $value, $pattern, $message = '')
public static resource( $value, $type = NULL, $message = '')
public static same( $value, $expect, $message = '')
public static scalar( $value, $message = '')
 
public static startsWith( $value, $prefix, $message = '')
public static startsWithLetter( $value, $message = '')
public static string( $value, $message = '')
 
public static stringNotEmpty( $value, $message = '')
 
public static subclassOf( $value, $class, $message = '')
 
public static throws(Closure $expression, $class = 'Exception', $message = '')
public static true( $value, $message = '')
public static unicodeLetters( $value, $message = '')
public static uniqueValues(array $values, $message = '')
 

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

public static upper( $value, $message = '')
 
public static uuid( $value, $message = '')
public static validArrayKey( $value, $message = '')
 

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

public static writable( $value, $message = '')
Methods
protected static reportInvalidArgument( $message)
 
protected static strlen( $value)
protected static typeToString( $value)
protected static valueToString( $value)
Methods
private __construct()
Methods
public static __callStatic( $name, $arguments)
public static allAlnum( $value, $message = '')
public static allAlpha( $value, $message = '')
public static allBoolean( $value, $message = '')
public static allClassExists( $value, $message = '')
public static allContains( $value, $subString, $message = '')
public static allCount( $array, $number, $message = '')
public static allCountBetween( $array, $min, $max, $message = '')
public static allDigits( $value, $message = '')
public static allDirectory( $value, $message = '')
public static allEmail( $value, $message = '')
public static allEndsWith( $value, $suffix, $message = '')
public static allEq( $value, $expect, $message = '')
public static allFalse( $value, $message = '')
public static allFile( $value, $message = '')
public static allFileExists( $value, $message = '')
public static allFloat( $value, $message = '')
public static allGreaterThan( $value, $limit, $message = '')
public static allGreaterThanEq( $value, $limit, $message = '')
public static allImplementsInterface( $value, $interface, $message = '')
 
public static allInArray( $value, $values, $message = '')
public static allInteger( $value, $message = '')
public static allIntegerish( $value, $message = '')
public static allInterfaceExists( $value, $message = '')
public static allIp( $value, $message = '')
public static allIpv4( $value, $message = '')
public static allIpv6( $value, $message = '')
public static allIsAnyOf( $value, $classes, $message = '')
public static allIsAOf( $value, $class, $message = '')
 
public static allIsArray( $value, $message = '')
public static allIsArrayAccessible( $value, $message = '')
 
public static allIsCallable( $value, $message = '')
public static allIsCountable( $value, $message = '')
public static allIsEmpty( $value, $message = '')
public static allIsInstanceOf( $value, $class, $message = '')
 
public static allIsInstanceOfAny( $value, $classes, $message = '')
public static allIsIterable( $value, $message = '')
public static allIsList( $array, $message = '')
public static allIsMap( $array, $message = '')
 
public static allIsNonEmptyList( $array, $message = '')
 
public static allIsNonEmptyMap( $array, $message = '')
 
public static allIsNotA( $value, $class, $message = '')
 
public static allIsTraversable( $value, $message = '')
 
public static allKeyExists( $array, $key, $message = '')
public static allKeyNotExists( $array, $key, $message = '')
public static allLength( $value, $length, $message = '')
public static allLengthBetween( $value, $min, $max, $message = '')
public static allLessThan( $value, $limit, $message = '')
public static allLessThanEq( $value, $limit, $message = '')
public static allLower( $value, $message = '')
 
public static allMaxCount( $array, $max, $message = '')
public static allMaxLength( $value, $max, $message = '')
public static allMethodExists( $classOrObject, $method, $message = '')
 
public static allMethodNotExists( $classOrObject, $method, $message = '')
 
public static allMinCount( $array, $min, $message = '')
public static allMinLength( $value, $min, $message = '')
public static allNatural( $value, $message = '')
 
public static allNotContains( $value, $subString, $message = '')
public static allNotEmpty( $value, $message = '')
public static allNotEndsWith( $value, $suffix, $message = '')
public static allNotEq( $value, $expect, $message = '')
public static allNotFalse( $value, $message = '')
public static allNotInstanceOf( $value, $class, $message = '')
 
public static allNotNull( $value, $message = '')
public static allNotRegex( $value, $pattern, $message = '')
public static allNotSame( $value, $expect, $message = '')
public static allNotStartsWith( $value, $prefix, $message = '')
public static allNotWhitespaceOnly( $value, $message = '')
public static allNull( $value, $message = '')
public static allNullOrAlnum( $value, $message = '')
public static allNullOrAlpha( $value, $message = '')
public static allNullOrBoolean( $value, $message = '')
public static allNullOrClassExists( $value, $message = '')
public static allNullOrContains( $value, $subString, $message = '')
public static allNullOrCount( $array, $number, $message = '')
public static allNullOrCountBetween( $array, $min, $max, $message = '')
public static allNullOrDigits( $value, $message = '')
public static allNullOrDirectory( $value, $message = '')
public static allNullOrEmail( $value, $message = '')
public static allNullOrEndsWith( $value, $suffix, $message = '')
public static allNullOrEq( $value, $expect, $message = '')
public static allNullOrFalse( $value, $message = '')
public static allNullOrFile( $value, $message = '')
public static allNullOrFileExists( $value, $message = '')
public static allNullOrFloat( $value, $message = '')
public static allNullOrGreaterThan( $value, $limit, $message = '')
public static allNullOrGreaterThanEq( $value, $limit, $message = '')
public static allNullOrImplementsInterface( $value, $interface, $message = '')
 
public static allNullOrInArray( $value, $values, $message = '')
public static allNullOrInteger( $value, $message = '')
public static allNullOrIntegerish( $value, $message = '')
 
public static allNullOrInterfaceExists( $value, $message = '')
public static allNullOrIp( $value, $message = '')
public static allNullOrIpv4( $value, $message = '')
public static allNullOrIpv6( $value, $message = '')
public static allNullOrIsAnyOf( $value, $classes, $message = '')
public static allNullOrIsAOf( $value, $class, $message = '')
 
public static allNullOrIsArray( $value, $message = '')
public static allNullOrIsArrayAccessible( $value, $message = '')
 
public static allNullOrIsCallable( $value, $message = '')
 
public static allNullOrIsCountable( $value, $message = '')
 
public static allNullOrIsEmpty( $value, $message = '')
public static allNullOrIsInstanceOf( $value, $class, $message = '')
 
public static allNullOrIsInstanceOfAny( $value, $classes, $message = '')
public static allNullOrIsIterable( $value, $message = '')
 
public static allNullOrIsList( $array, $message = '')
public static allNullOrIsMap( $array, $message = '')
 
public static allNullOrIsNonEmptyList( $array, $message = '')
 
public static allNullOrIsNonEmptyMap( $array, $message = '')
 
public static allNullOrIsNotA( $value, $class, $message = '')
 
public static allNullOrIsTraversable( $value, $message = '')
 
public static allNullOrKeyExists( $array, $key, $message = '')
public static allNullOrKeyNotExists( $array, $key, $message = '')
public static allNullOrLength( $value, $length, $message = '')
public static allNullOrLengthBetween( $value, $min, $max, $message = '')
public static allNullOrLessThan( $value, $limit, $message = '')
public static allNullOrLessThanEq( $value, $limit, $message = '')
public static allNullOrLower( $value, $message = '')
 
public static allNullOrMaxCount( $array, $max, $message = '')
public static allNullOrMaxLength( $value, $max, $message = '')
public static allNullOrMethodExists( $classOrObject, $method, $message = '')
 
public static allNullOrMethodNotExists( $classOrObject, $method, $message = '')
 
public static allNullOrMinCount( $array, $min, $message = '')
public static allNullOrMinLength( $value, $min, $message = '')
public static allNullOrNatural( $value, $message = '')
 
public static allNullOrNotContains( $value, $subString, $message = '')
public static allNullOrNotEmpty( $value, $message = '')
 
public static allNullOrNotEndsWith( $value, $suffix, $message = '')
public static allNullOrNotEq( $value, $expect, $message = '')
public static allNullOrNotFalse( $value, $message = '')
 
public static allNullOrNotInstanceOf( $value, $class, $message = '')
 
public static allNullOrNotRegex( $value, $pattern, $message = '')
public static allNullOrNotSame( $value, $expect, $message = '')
public static allNullOrNotStartsWith( $value, $prefix, $message = '')
public static allNullOrNotWhitespaceOnly( $value, $message = '')
public static allNullOrNumeric( $value, $message = '')
 
public static allNullOrObject( $value, $message = '')
 
public static allNullOrOneOf( $value, $values, $message = '')
public static allNullOrPositiveInteger( $value, $message = '')
 
public static allNullOrPropertyExists( $classOrObject, $property, $message = '')
 
public static allNullOrPropertyNotExists( $classOrObject, $property, $message = '')
 
public static allNullOrRange( $value, $min, $max, $message = '')
public static allNullOrReadable( $value, $message = '')
public static allNullOrRegex( $value, $pattern, $message = '')
public static allNullOrResource( $value, $type = NULL, $message = '')
public static allNullOrSame( $value, $expect, $message = '')
public static allNullOrScalar( $value, $message = '')
 
public static allNullOrStartsWith( $value, $prefix, $message = '')
public static allNullOrStartsWithLetter( $value, $message = '')
public static allNullOrString( $value, $message = '')
 
public static allNullOrStringNotEmpty( $value, $message = '')
 
public static allNullOrSubclassOf( $value, $class, $message = '')
 
public static allNullOrThrows( $expression, $class = 'Exception', $message = '')
public static allNullOrTrue( $value, $message = '')
public static allNullOrUnicodeLetters( $value, $message = '')
public static allNullOrUniqueValues( $values, $message = '')
public static allNullOrUpper( $value, $message = '')
 
public static allNullOrUuid( $value, $message = '')
public static allNullOrValidArrayKey( $value, $message = '')
 
public static allNullOrWritable( $value, $message = '')
public static allNumeric( $value, $message = '')
public static allObject( $value, $message = '')
public static allOneOf( $value, $values, $message = '')
public static allPositiveInteger( $value, $message = '')
 
public static allPropertyExists( $classOrObject, $property, $message = '')
 
public static allPropertyNotExists( $classOrObject, $property, $message = '')
 
public static allRange( $value, $min, $max, $message = '')
public static allReadable( $value, $message = '')
public static allRegex( $value, $pattern, $message = '')
public static allResource( $value, $type = NULL, $message = '')
public static allSame( $value, $expect, $message = '')
public static allScalar( $value, $message = '')
public static allStartsWith( $value, $prefix, $message = '')
public static allStartsWithLetter( $value, $message = '')
public static allString( $value, $message = '')
public static allStringNotEmpty( $value, $message = '')
 
public static allSubclassOf( $value, $class, $message = '')
 
public static allThrows( $expression, $class = 'Exception', $message = '')
public static allTrue( $value, $message = '')
public static allUnicodeLetters( $value, $message = '')
public static allUniqueValues( $values, $message = '')
public static allUpper( $value, $message = '')
public static allUuid( $value, $message = '')
public static allValidArrayKey( $value, $message = '')
public static allWritable( $value, $message = '')
public static alnum( $value, $message = '')
public static alpha( $value, $message = '')
public static boolean( $value, $message = '')
public static classExists( $value, $message = '')
public static contains( $value, $subString, $message = '')
public static count( $array, $number, $message = '')
 

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

public static countBetween( $array, $min, $max, $message = '')
 

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

public static digits( $value, $message = '')
public static directory( $value, $message = '')
public static email( $value, $message = '')
public static endsWith( $value, $suffix, $message = '')
public static eq( $value, $expect, $message = '')
public static false( $value, $message = '')
 
public static file( $value, $message = '')
public static fileExists( $value, $message = '')
 

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

public static float( $value, $message = '')
 
public static greaterThan( $value, $limit, $message = '')
public static greaterThanEq( $value, $limit, $message = '')