Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Assertion

Fonctions membres publiques statiques

static eq ($value, $value2, $message=null, string $propertyPath=null)
 
static eqArraySubset ($value, $value2, $message=null, string $propertyPath=null)
 
static same ($value, $value2, $message=null, string $propertyPath=null)
 
static notEq ($value1, $value2, $message=null, string $propertyPath=null)
 
static notSame ($value1, $value2, $message=null, string $propertyPath=null)
 
static notInArray ($value, array $choices, $message=null, string $propertyPath=null)
 
static integer ($value, $message=null, string $propertyPath=null)
 
static float ($value, $message=null, string $propertyPath=null)
 
static digit ($value, $message=null, string $propertyPath=null)
 
static integerish ($value, $message=null, string $propertyPath=null)
 
static boolean ($value, $message=null, string $propertyPath=null)
 
static scalar ($value, $message=null, string $propertyPath=null)
 
static notEmpty ($value, $message=null, string $propertyPath=null)
 
static noContent ($value, $message=null, string $propertyPath=null)
 
static null ($value, $message=null, string $propertyPath=null)
 
static notNull ($value, $message=null, string $propertyPath=null)
 
static string ($value, $message=null, string $propertyPath=null)
 
static regex ($value, $pattern, $message=null, string $propertyPath=null)
 
static notRegex ($value, $pattern, $message=null, string $propertyPath=null)
 
static length ($value, $length, $message=null, string $propertyPath=null, $encoding='utf8')
 
static minLength ($value, $minLength, $message=null, string $propertyPath=null, $encoding='utf8')
 
static maxLength ($value, $maxLength, $message=null, string $propertyPath=null, $encoding='utf8')
 
static betweenLength ($value, $minLength, $maxLength, $message=null, string $propertyPath=null, $encoding='utf8')
 
static startsWith ($string, $needle, $message=null, string $propertyPath=null, $encoding='utf8')
 
static endsWith ($string, $needle, $message=null, string $propertyPath=null, $encoding='utf8')
 
static contains ($string, $needle, $message=null, string $propertyPath=null, $encoding='utf8')
 
static notContains ($string, $needle, $message=null, string $propertyPath=null, $encoding='utf8')
 
static choice ($value, array $choices, $message=null, string $propertyPath=null)
 
static inArray ($value, array $choices, $message=null, string $propertyPath=null)
 
static numeric ($value, $message=null, string $propertyPath=null)
 
static isResource ($value, $message=null, string $propertyPath=null)
 
static isArray ($value, $message=null, string $propertyPath=null)
 
static isTraversable ($value, $message=null, string $propertyPath=null)
 
static isArrayAccessible ($value, $message=null, string $propertyPath=null)
 
static isCountable ($value, $message=null, string $propertyPath=null)
 
static keyExists ($value, $key, $message=null, string $propertyPath=null)
 
static keyNotExists ($value, $key, $message=null, string $propertyPath=null)
 
static uniqueValues (array $values, $message=null, string $propertyPath=null)
 
static keyIsset ($value, $key, $message=null, string $propertyPath=null)
 
static notEmptyKey ($value, $key, $message=null, string $propertyPath=null)
 
static notBlank ($value, $message=null, string $propertyPath=null)
 
static isInstanceOf ($value, $className, $message=null, string $propertyPath=null)
 
static notIsInstanceOf ($value, $className, $message=null, string $propertyPath=null)
 
static subclassOf ($value, $className, $message=null, string $propertyPath=null)
 
static range ($value, $minValue, $maxValue, $message=null, string $propertyPath=null)
 
static min ($value, $minValue, $message=null, string $propertyPath=null)
 
static max ($value, $maxValue, $message=null, string $propertyPath=null)
 
static file ($value, $message=null, string $propertyPath=null)
 
static directory ($value, $message=null, string $propertyPath=null)
 
static readable ($value, $message=null, string $propertyPath=null)
 
static writeable ($value, $message=null, string $propertyPath=null)
 
static email ($value, $message=null, string $propertyPath=null)
 
static url ($value, $message=null, string $propertyPath=null)
 
static alnum ($value, $message=null, string $propertyPath=null)
 
static true ($value, $message=null, string $propertyPath=null)
 
static false ($value, $message=null, string $propertyPath=null)
 
static classExists ($value, $message=null, string $propertyPath=null)
 
static interfaceExists ($value, $message=null, string $propertyPath=null)
 
static implementsInterface ($class, $interfaceName, $message=null, string $propertyPath=null)
 
static isJsonString ($value, $message=null, string $propertyPath=null)
 
static uuid ($value, $message=null, string $propertyPath=null)
 
static e164 ($value, $message=null, string $propertyPath=null)
 
static count ($countable, $count, $message=null, string $propertyPath=null)
 
static minCount ($countable, $count, $message=null, string $propertyPath=null)
 
static maxCount ($countable, $count, $message=null, string $propertyPath=null)
 
static __callStatic ($method, $args)
 
static choicesNotEmpty (array $values, array $choices, $message=null, string $propertyPath=null)
 
static methodExists ($value, $object, $message=null, string $propertyPath=null)
 
static isObject ($value, $message=null, string $propertyPath=null)
 
static lessThan ($value, $limit, $message=null, string $propertyPath=null)
 
static lessOrEqualThan ($value, $limit, $message=null, string $propertyPath=null)
 
static greaterThan ($value, $limit, $message=null, string $propertyPath=null)
 
static greaterOrEqualThan ($value, $limit, $message=null, string $propertyPath=null)
 
static between ($value, $lowerLimit, $upperLimit, $message=null, string $propertyPath=null)
 
static betweenExclusive ($value, $lowerLimit, $upperLimit, $message=null, string $propertyPath=null)
 
static extensionLoaded ($value, $message=null, string $propertyPath=null)
 
static date ($value, $format, $message=null, string $propertyPath=null)
 
static objectOrClass ($value, $message=null, string $propertyPath=null)
 
static propertyExists ($value, $property, $message=null, string $propertyPath=null)
 
static propertiesExist ($value, array $properties, $message=null, string $propertyPath=null)
 
static version ($version1, $operator, $version2, $message=null, string $propertyPath=null)
 
static phpVersion ($operator, $version, $message=null, string $propertyPath=null)
 
static extensionVersion ($extension, $operator, $version, $message=null, string $propertyPath=null)
 
static isCallable ($value, $message=null, string $propertyPath=null)
 
static satisfy ($value, $callback, $message=null, string $propertyPath=null)
 
static ip ($value, $flag=null, $message=null, string $propertyPath=null)
 
static ipv4 ($value, $flag=null, $message=null, string $propertyPath=null)
 
static ipv6 ($value, $flag=null, $message=null, string $propertyPath=null)
 
static defined ($constant, $message=null, string $propertyPath=null)
 
static base64 ($value, $message=null, string $propertyPath=null)
 

Champs de données

const INVALID_FLOAT = 9
 
const INVALID_INTEGER = 10
 
const INVALID_DIGIT = 11
 
const INVALID_INTEGERISH = 12
 
const INVALID_BOOLEAN = 13
 
const VALUE_EMPTY = 14
 
const VALUE_NULL = 15
 
const VALUE_NOT_NULL = 25
 
const INVALID_STRING = 16
 
const INVALID_REGEX = 17
 
const INVALID_MIN_LENGTH = 18
 
const INVALID_MAX_LENGTH = 19
 
const INVALID_STRING_START = 20
 
const INVALID_STRING_CONTAINS = 21
 
const INVALID_CHOICE = 22
 
const INVALID_NUMERIC = 23
 
const INVALID_ARRAY = 24
 
const INVALID_KEY_EXISTS = 26
 
const INVALID_NOT_BLANK = 27
 
const INVALID_INSTANCE_OF = 28
 
const INVALID_SUBCLASS_OF = 29
 
const INVALID_RANGE = 30
 
const INVALID_ALNUM = 31
 
const INVALID_TRUE = 32
 
const INVALID_EQ = 33
 
const INVALID_SAME = 34
 
const INVALID_MIN = 35
 
const INVALID_MAX = 36
 
const INVALID_LENGTH = 37
 
const INVALID_FALSE = 38
 
const INVALID_STRING_END = 39
 
const INVALID_UUID = 40
 
const INVALID_COUNT = 41
 
const INVALID_NOT_EQ = 42
 
const INVALID_NOT_SAME = 43
 
const INVALID_TRAVERSABLE = 44
 
const INVALID_ARRAY_ACCESSIBLE = 45
 
const INVALID_KEY_ISSET = 46
 
const INVALID_VALUE_IN_ARRAY = 47
 
const INVALID_E164 = 48
 
const INVALID_BASE64 = 49
 
const INVALID_NOT_REGEX = 50
 
const INVALID_DIRECTORY = 101
 
const INVALID_FILE = 102
 
const INVALID_READABLE = 103
 
const INVALID_WRITEABLE = 104
 
const INVALID_CLASS = 105
 
const INVALID_INTERFACE = 106
 
const INVALID_FILE_NOT_EXISTS = 107
 
const INVALID_EMAIL = 201
 
const INTERFACE_NOT_IMPLEMENTED = 202
 
const INVALID_URL = 203
 
const INVALID_NOT_INSTANCE_OF = 204
 
const VALUE_NOT_EMPTY = 205
 
const INVALID_JSON_STRING = 206
 
const INVALID_OBJECT = 207
 
const INVALID_METHOD = 208
 
const INVALID_SCALAR = 209
 
const INVALID_LESS = 210
 
const INVALID_LESS_OR_EQUAL = 211
 
const INVALID_GREATER = 212
 
const INVALID_GREATER_OR_EQUAL = 213
 
const INVALID_DATE = 214
 
const INVALID_CALLABLE = 215
 
const INVALID_KEY_NOT_EXISTS = 216
 
const INVALID_SATISFY = 217
 
const INVALID_IP = 218
 
const INVALID_BETWEEN = 219
 
const INVALID_BETWEEN_EXCLUSIVE = 220
 
const INVALID_EXTENSION = 222
 
const INVALID_CONSTANT = 221
 
const INVALID_VERSION = 223
 
const INVALID_PROPERTY = 224
 
const INVALID_RESOURCE = 225
 
const INVALID_COUNTABLE = 226
 
const INVALID_MIN_COUNT = 227
 
const INVALID_MAX_COUNT = 228
 
const INVALID_STRING_NOT_CONTAINS = 229
 
const INVALID_UNIQUE_VALUES = 230
 

Fonctions membres protégées statiques

static createException ($value, $message, $code, $propertyPath=null, array $constraints=[])
 
static stringify ($value)
 
static generateMessage ($message)
 

Attributs protégés statiques

static $exceptionClass = InvalidArgumentException::class
 

Description détaillée

Assert library.

Auteur
Benjamin Eberlei konta.nosp@m.kt@b.nosp@m.eberl.nosp@m.ei.d.nosp@m.e

static bool allAlnum(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric for all values. static bool allBase64(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined for all values. static bool allBetween(mixed[] $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit for all values. static bool allBetweenExclusive(mixed[] $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit for all values. static bool allBetweenLength(mixed[] $value, int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths for all values. static bool allBoolean(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is php boolean for all values. static bool allChoice(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices for all values. static bool allChoicesNotEmpty(array[] $values, array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content for all values. static bool allClassExists(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the class exists for all values. static bool allContains(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars for all values. static bool allCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count for all values. static bool allDate(string[] $value, string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format for all values. static bool allDefined(mixed[] $constant, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined for all values. static bool allDigit(mixed[] $value, string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit for all values. static bool allDirectory(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a directory exists for all values. static bool allE164(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number for all values. static bool allEmail(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL) for all values. static bool allEndsWith(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars for all values. static bool allEq(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==) for all values. static bool allEqArraySubset(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset for all values. static bool allExtensionLoaded(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded for all values. static bool allExtensionVersion(string[] $extension, string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed for all values. static bool allFalse(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False for all values. static bool allFile(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that a file exists for all values. static bool allFloat(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php float for all values. static bool allGreaterOrEqualThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit for all values. static bool allGreaterThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit for all values. static bool allImplementsInterface(mixed[] $class, string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface for all values. static bool allInArray(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice() for all values. static bool allInteger(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer for all values. static bool allIntegerish(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish for all values. static bool allInterfaceExists(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the interface exists for all values. static bool allIp(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address for all values. static bool allIpv4(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address for all values. static bool allIpv6(string[] $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address for all values. static bool allIsArray(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array for all values. static bool allIsArrayAccessible(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object for all values. static bool allIsCallable(mixed[] $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable for all values. static bool allIsCountable(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is countable for all values. static bool allIsInstanceOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name for all values. static bool allIsJsonString(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string for all values. static bool allIsObject(mixed[] $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object for all values. static bool allIsResource(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a resource for all values. static bool allIsTraversable(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object for all values. static bool allKeyExists(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array for all values. static bool allKeyIsset(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset() for all values. static bool allKeyNotExists(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array for all values. static bool allLength(mixed[] $value, int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length for all values. static bool allLessOrEqualThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit for all values. static bool allLessThan(mixed[] $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit for all values. static bool allMax(mixed[] $value, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit for all values. static bool allMaxCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements for all values. static bool allMaxLength(mixed[] $value, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars for all values. static bool allMethodExists(string[] $value, mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object for all values. static bool allMin(mixed[] $value, mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit for all values. static bool allMinCount(array[]|Countable[]|ResourceBundle[]|SimpleXMLElement[] $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements for all values. static bool allMinLength(mixed[] $value, int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long for all values. static bool allNoContent(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty for all values. static bool allNotBlank(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not blank for all values. static bool allNotContains(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars for all values. static bool allNotEmpty(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not empty for all values. static bool allNotEmptyKey(mixed[] $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty for all values. static bool allNotEq(mixed[] $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==) for all values. static bool allNotInArray(mixed[] $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices for all values. static bool allNotIsInstanceOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name for all values. static bool allNotNull(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is not null for all values. static bool allNotRegex(mixed[] $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex for all values. static bool allNotSame(mixed[] $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===) for all values. static bool allNull(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is null for all values. static bool allNumeric(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric for all values. static bool allObjectOrClass(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists for all values. static bool allPhpVersion(string[] $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version for all values. static bool allPropertiesExist(mixed[] $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist for all values. static bool allPropertyExists(mixed[] $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists for all values. static bool allRange(mixed[] $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers for all values. static bool allReadable(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable for all values. static bool allRegex(mixed[] $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex for all values. static bool allSame(mixed[] $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===) for all values. static bool allSatisfy(mixed[] $value, callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback for all values. static bool allScalar(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar for all values. static bool allStartsWith(mixed[] $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars for all values. static bool allString(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is a string for all values. static bool allSubclassOf(mixed[] $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name for all values. static bool allTrue(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True for all values. static bool allUniqueValues(array[] $values, string|callable $message = null, string $propertyPath = null) Assert that values in array are unique (using strict equality) for all values. static bool allUrl(mixed[] $value, string|callable $message = null, string $propertyPath = null) Assert that value is an URL for all values. static bool allUuid(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID for all values. static bool allVersion(string[] $version1, string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions for all values. static bool allWriteable(string[] $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable for all values. static bool nullOrAlnum(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is alphanumeric or that the value is null. static bool nullOrBase64(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined or that the value is null. static bool nullOrBetween(mixed|null $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit or that the value is null. static bool nullOrBetweenExclusive(mixed|null $value, mixed $lowerLimit, mixed $upperLimit, string|callable $message = null, string $propertyPath = null) Assert that a value is greater than a lower limit, and less than an upper limit or that the value is null. static bool nullOrBetweenLength(mixed|null $value, int $minLength, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string length is between min and max lengths or that the value is null. static bool nullOrBoolean(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is php boolean or that the value is null. static bool nullOrChoice(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices or that the value is null. static bool nullOrChoicesNotEmpty(array|null $values, array $choices, string|callable $message = null, string $propertyPath = null) Determines if the values array has every choice as key and that this choice has content or that the value is null. static bool nullOrClassExists(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the class exists or that the value is null. static bool nullOrContains(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string contains a sequence of chars or that the value is null. static bool nullOrCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the count of countable is equal to count or that the value is null. static bool nullOrDate(string|null $value, string $format, string|callable $message = null, string $propertyPath = null) Assert that date is valid and corresponds to the given format or that the value is null. static bool nullOrDefined(mixed|null $constant, string|callable $message = null, string $propertyPath = null) Assert that a constant is defined or that the value is null. static bool nullOrDigit(mixed|null $value, string|callable $message = null, string $propertyPath = null) Validates if an integer or integerish is a digit or that the value is null. static bool nullOrDirectory(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a directory exists or that the value is null. static bool nullOrE164(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid E164 Phone Number or that the value is null. static bool nullOrEmail(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL) or that the value is null. static bool nullOrEndsWith(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string ends with a sequence of chars or that the value is null. static bool nullOrEq(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are equal (using ==) or that the value is null. static bool nullOrEqArraySubset(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that the array contains the subset or that the value is null. static bool nullOrExtensionLoaded(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded or that the value is null. static bool nullOrExtensionVersion(string|null $extension, string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert that extension is loaded and a specific version is installed or that the value is null. static bool nullOrFalse(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean False or that the value is null. static bool nullOrFile(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that a file exists or that the value is null. static bool nullOrFloat(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php float or that the value is null. static bool nullOrGreaterOrEqualThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater or equal than given limit or that the value is null. static bool nullOrGreaterThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is greater than given limit or that the value is null. static bool nullOrImplementsInterface(mixed|null $class, string $interfaceName, string|callable $message = null, string $propertyPath = null) Assert that the class implements the interface or that the value is null. static bool nullOrInArray(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is in array of choices. This is an alias of Assertion::choice() or that the value is null. static bool nullOrInteger(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer or that the value is null. static bool nullOrIntegerish(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a php integer'ish or that the value is null. static bool nullOrInterfaceExists(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the interface exists or that the value is null. static bool nullOrIp(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 or IPv6 address or that the value is null. static bool nullOrIpv4(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv4 address or that the value is null. static bool nullOrIpv6(string|null $value, int $flag = null, string|callable $message = null, string $propertyPath = null) Assert that value is an IPv6 address or that the value is null. static bool nullOrIsArray(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or that the value is null. static bool nullOrIsArrayAccessible(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or an array-accessible object or that the value is null. static bool nullOrIsCallable(mixed|null $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is callable or that the value is null. static bool nullOrIsCountable(array|Countable|ResourceBundle|SimpleXMLElement|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is countable or that the value is null. static bool nullOrIsInstanceOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is instance of given class-name or that the value is null. static bool nullOrIsJsonString(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid json string or that the value is null. static bool nullOrIsObject(mixed|null $value, string|callable $message = null, string $propertyPath = null) Determines that the provided value is an object or that the value is null. static bool nullOrIsResource(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a resource or that the value is null. static bool nullOrIsTraversable(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an array or a traversable object or that the value is null. static bool nullOrKeyExists(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array or that the value is null. static bool nullOrKeyIsset(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object using isset() or that the value is null. static bool nullOrKeyNotExists(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key does not exist in an array or that the value is null. static bool nullOrLength(mixed|null $value, int $length, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string has a given length or that the value is null. static bool nullOrLessOrEqualThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less or equal than given limit or that the value is null. static bool nullOrLessThan(mixed|null $value, mixed $limit, string|callable $message = null, string $propertyPath = null) Determines if the value is less than given limit or that the value is null. static bool nullOrMax(mixed|null $value, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that a number is smaller as a given limit or that the value is null. static bool nullOrMaxCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at most $count elements or that the value is null. static bool nullOrMaxLength(mixed|null $value, int $maxLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string value is not longer than $maxLength chars or that the value is null. static bool nullOrMethodExists(string|null $value, mixed $object, string|callable $message = null, string $propertyPath = null) Determines that the named method is defined in the provided object or that the value is null. static bool nullOrMin(mixed|null $value, mixed $minValue, string|callable $message = null, string $propertyPath = null) Assert that a value is at least as big as a given limit or that the value is null. static bool nullOrMinCount(array|Countable|ResourceBundle|SimpleXMLElement|null $countable, int $count, string|callable $message = null, string $propertyPath = null) Assert that the countable have at least $count elements or that the value is null. static bool nullOrMinLength(mixed|null $value, int $minLength, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that a string is at least $minLength chars long or that the value is null. static bool nullOrNoContent(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty or that the value is null. static bool nullOrNotBlank(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not blank or that the value is null. static bool nullOrNotContains(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string does not contains a sequence of chars or that the value is null. static bool nullOrNotEmpty(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not empty or that the value is null. static bool nullOrNotEmptyKey(mixed|null $value, string|int $key, string|callable $message = null, string $propertyPath = null) Assert that key exists in an array/array-accessible object and its value is not empty or that the value is null. static bool nullOrNotEq(mixed|null $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not equal (using ==) or that the value is null. static bool nullOrNotInArray(mixed|null $value, array $choices, string|callable $message = null, string $propertyPath = null) Assert that value is not in array of choices or that the value is null. static bool nullOrNotIsInstanceOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is not instance of given class-name or that the value is null. static bool nullOrNotNull(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is not null or that the value is null. static bool nullOrNotRegex(mixed|null $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value does not match a regex or that the value is null. static bool nullOrNotSame(mixed|null $value1, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are not the same (using ===) or that the value is null. static bool nullOrNull(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is null or that the value is null. static bool nullOrNumeric(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric or that the value is null. static bool nullOrObjectOrClass(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists or that the value is null. static bool nullOrPhpVersion(string|null $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version or that the value is null. static bool nullOrPropertiesExist(mixed|null $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist or that the value is null. static bool nullOrPropertyExists(mixed|null $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists or that the value is null. static bool nullOrRange(mixed|null $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers or that the value is null. static bool nullOrReadable(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable or that the value is null. static bool nullOrRegex(mixed|null $value, string $pattern, string|callable $message = null, string $propertyPath = null) Assert that value matches a regex or that the value is null. static bool nullOrSame(mixed|null $value, mixed $value2, string|callable $message = null, string $propertyPath = null) Assert that two values are the same (using ===) or that the value is null. static bool nullOrSatisfy(mixed|null $value, callable $callback, string|callable $message = null, string $propertyPath = null) Assert that the provided value is valid according to a callback or that the value is null. static bool nullOrScalar(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a PHP scalar or that the value is null. static bool nullOrStartsWith(mixed|null $string, string $needle, string|callable $message = null, string $propertyPath = null, string $encoding = 'utf8') Assert that string starts with a sequence of chars or that the value is null. static bool nullOrString(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is a string or that the value is null. static bool nullOrSubclassOf(mixed|null $value, string $className, string|callable $message = null, string $propertyPath = null) Assert that value is subclass of given class-name or that the value is null. static bool nullOrTrue(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is boolean True or that the value is null. static bool nullOrUniqueValues(array|null $values, string|callable $message = null, string $propertyPath = null) Assert that values in array are unique (using strict equality) or that the value is null. static bool nullOrUrl(mixed|null $value, string|callable $message = null, string $propertyPath = null) Assert that value is an URL or that the value is null. static bool nullOrUuid(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the given string is a valid UUID or that the value is null. static bool nullOrVersion(string|null $version1, string $operator, string $version2, string|callable $message = null, string $propertyPath = null) Assert comparison of two versions or that the value is null. static bool nullOrWriteable(string|null $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something writeable or that the value is null.

Documentation des fonctions membres

◆ __callStatic()

static __callStatic (   $method,
  $args 
)
static

static call handler to implement:

  • "null or assertion" delegation
  • "all" delegation.
Paramètres
string$method
array$args
Renvoie
bool|mixed
Exceptions
AssertionFailedException

Références $method, $value, et null.

◆ alnum()

static alnum (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is alphanumeric.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ base64()

static base64 (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a constant is defined.

Paramètres
string$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ between()

static between (   $value,
  $lowerLimit,
  $upperLimit,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a value is greater or equal than a lower limit, and less than or equal to an upper limit.

Paramètres
mixed$value
mixed$lowerLimit
mixed$upperLimit
string | callable | null$message
string$propertyPath
Exceptions
AssertionFailedException

Références $message, et $value.

◆ betweenExclusive()

static betweenExclusive (   $value,
  $lowerLimit,
  $upperLimit,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a value is greater than a lower limit, and less than an upper limit.

Paramètres
mixed$value
mixed$lowerLimit
mixed$upperLimit
string | callable | null$message
string$propertyPath
Exceptions
AssertionFailedException

Références $message, et $value.

◆ betweenLength()

static betweenLength (   $value,
  $minLength,
  $maxLength,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that string length is between min and max lengths.

Paramètres
mixed$value
int$minLength
int$maxLength
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ boolean()

static boolean (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is php boolean.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert bool $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

Référencé par AndroidSafetyNetAttestationStatementSupport\validateUsingGoogleApi().

◆ choice()

static choice (   $value,
array  $choices,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is in array of choices.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ choicesNotEmpty()

static choicesNotEmpty ( array  $values,
array  $choices,
  $message = null,
string  $propertyPath = null 
)
static

Determines if the values array has every choice as key and that this choice has content.

Paramètres
string | callable | null$message
Exceptions
AssertionFailedException

Références $message.

◆ classExists()

static classExists (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the class exists.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert class-string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ contains()

static contains (   $string,
  $needle,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that string contains a sequence of chars.

Paramètres
mixed$string
string$needle
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $string
Renvoie
bool
Exceptions
AssertionFailedException

Références $message.

◆ count()

static count (   $countable,
  $count,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the count of countable is equal to count.

Paramètres
array | Countable | ResourceBundle | SimpleXMLElement$countable
int$count
string | callable | null$message
string | null$propertyPath
Renvoie
bool
Exceptions
AssertionFailedException

Références $count, et $message.

Référencé par FidoU2FAttestationStatementSupport\load().

◆ createException()

static createException (   $value,
  $message,
  $code,
  $propertyPath = null,
array  $constraints = [] 
)
staticprotected

Helper method that handles building the assertion failure exceptions. They are returned from this method so that the stack trace still shows the assertions method.

Paramètres
mixed$value
string | callable | null$message
int$code
Renvoie
mixed

Références $message, et $value.

◆ date()

static date (   $value,
  $format,
  $message = null,
string  $propertyPath = null 
)
static

Assert that date is valid and corresponds to the given format.

Paramètres
string$value
string$formatsupports all of the options date(), except for the following: N, w, W, t, L, o, B, a, A, g, h, I, O, P, Z, c, r
string | callable | null$message
Exceptions
AssertionFailedException
Voir également
http://php.net/manual/function.date.php#refsect1-function.date-parameters

Références $format, $message, et $value.

◆ defined()

static defined (   $constant,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a constant is defined.

Paramètres
mixed$constant
string | callable | null$message

Références $message.

◆ digit()

static digit (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Validates if an integer or integerish is a digit.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert =numeric $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ directory()

static directory (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a directory exists.

Paramètres
string$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ e164()

static e164 (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the given string is a valid E164 Phone Number.

Voir également
https://en.wikipedia.org/wiki/E.164
Paramètres
string$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ email()

static email (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is an email address (using input_filter/FILTER_VALIDATE_EMAIL).

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ endsWith()

static endsWith (   $string,
  $needle,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that string ends with a sequence of chars.

Paramètres
mixed$string
string$needle
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $string
Renvoie
bool
Exceptions
AssertionFailedException

Références $message.

◆ eq()

◆ eqArraySubset()

static eqArraySubset (   $value,
  $value2,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the array contains the subset.

Paramètres
mixed$value
mixed$value2
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ extensionLoaded()

static extensionLoaded (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that extension is loaded.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ extensionVersion()

static extensionVersion (   $extension,
  $operator,
  $version,
  $message = null,
string  $propertyPath = null 
)
static

Assert that extension is loaded and a specific version is installed.

Paramètres
string$extension
string$operator
mixed$version
string | callable | null$message
Exceptions
AssertionFailedException

Références $extension, $message, et $version.

◆ false()

static false (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the value is boolean False.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert false $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

Référencé par TokenBinding\__construct(), RsaKey\asPem(), PackedAttestationStatementSupport\checkCertificate(), et TPMAttestationStatementSupport\checkCertificate().

◆ file()

static file (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a file exists.

Paramètres
string$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ float()

static float (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is a php float.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert float $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ generateMessage()

static generateMessage (   $message)
staticprotected

Generate the message.

Paramètres
string | callable | null$message

Références $message, $method, et $parameters.

◆ greaterOrEqualThan()

static greaterOrEqualThan (   $value,
  $limit,
  $message = null,
string  $propertyPath = null 
)
static

Determines if the value is greater or equal than given limit.

Paramètres
mixed$value
mixed$limit
string | callable | null$message
Exceptions
AssertionFailedException

Références $limit, $message, et $value.

◆ greaterThan()

static greaterThan (   $value,
  $limit,
  $message = null,
string  $propertyPath = null 
)
static

Determines if the value is greater than given limit.

Paramètres
mixed$value
mixed$limit
string | callable | null$message
Exceptions
AssertionFailedException

Références $limit, $message, et $value.

Référencé par AndroidKeyAttestationStatementSupport\load().

◆ implementsInterface()

static implementsInterface (   $class,
  $interfaceName,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the class implements the interface.

Paramètres
mixed$class
string$interfaceName
string | callable | null$message
Exceptions
AssertionFailedException

Références $class, et $message.

◆ inArray()

static inArray (   $value,
array  $choices,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is in array of choices.

This is an alias of {

Voir également
choice()}.
Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

Référencé par OkpKey\__construct(), Ec2Key\__construct(), et TokenBinding\createFormArray().

◆ integer()

static integer (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is a php integer.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert int $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

Référencé par TPMAttestationStatementSupport\checkCertificate(), et AndroidSafetyNetAttestationStatementSupport\validatePayload().

◆ integerish()

static integerish (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is a php integer'ish.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ interfaceExists()

static interfaceExists (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the interface exists.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert class-string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ ip()

static ip (   $value,
  $flag = null,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is an IPv4 or IPv6 address (using input_filter/FILTER_VALIDATE_IP).

Paramètres
string$value
int | null$flag
string | callable | null$message
Exceptions
AssertionFailedException
Voir également
http://php.net/manual/filter.filters.flags.php

Références $message, $value, et null.

◆ ipv4()

static ipv4 (   $value,
  $flag = null,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is an IPv4 address (using input_filter/FILTER_VALIDATE_IP).

Paramètres
string$value
int | null$flag
string | callable | null$message
Exceptions
AssertionFailedException
Voir également
http://php.net/manual/filter.filters.flags.php

Références $message, et $value.

◆ ipv6()

static ipv6 (   $value,
  $flag = null,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is an IPv6 address (using input_filter/FILTER_VALIDATE_IP).

Paramètres
string$value
int | null$flag
string | callable | null$message
Exceptions
AssertionFailedException
Voir également
http://php.net/manual/filter.filters.flags.php

Références $message, et $value.

◆ isArray()

◆ isArrayAccessible()

static isArrayAccessible (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is an array or an array-accessible object.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ isCallable()

static isCallable (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Determines that the provided value is callable.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert callable $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ isCountable()

static isCountable (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is countable.

Paramètres
array | Countable | ResourceBundle | SimpleXMLElement$value
string | callable | null$message
string | null$propertyPath-assert countable $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ isInstanceOf()

◆ isJsonString()

static isJsonString (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the given string is a valid json string.

NOTICE: Since this does a json_decode to determine its validity you probably should consider, when using the variable content afterwards, just to decode and check for yourself instead of using this assertion.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, $value, et null.

◆ isObject()

static isObject (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Determines that the provided value is an object.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert object $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ isResource()

static isResource (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is a resource.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert resource $value
Renvoie
bool

Références $message, et $value.

Référencé par FidoU2FAttestationStatementSupport\checkCertificate(), et AndroidKeyAttestationStatementSupport\checkCertificateAndGetPublicKey().

◆ isTraversable()

static isTraversable (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is an array or a traversable object.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert iterable $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ keyExists()

◆ keyIsset()

static keyIsset (   $value,
  $key,
  $message = null,
string  $propertyPath = null 
)
static

Assert that key exists in an array/array-accessible object using isset().

Paramètres
mixed$value
string | int$key
string | callable | null$message
Exceptions
AssertionFailedException

Références $key, $message, et $value.

◆ keyNotExists()

static keyNotExists (   $value,
  $key,
  $message = null,
string  $propertyPath = null 
)
static

Assert that key does not exist in an array.

Paramètres
mixed$value
string | int$key
string | callable | null$message
Exceptions
AssertionFailedException

Références $key, $message, et $value.

Référencé par TPMAttestationStatementSupport\load().

◆ length()

static length (   $value,
  $length,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that string has a given length.

Paramètres
mixed$value
int$length
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

Référencé par Ec2Key\__construct().

◆ lessOrEqualThan()

static lessOrEqualThan (   $value,
  $limit,
  $message = null,
string  $propertyPath = null 
)
static

Determines if the value is less or equal than given limit.

Paramètres
mixed$value
mixed$limit
string | callable | null$message
Exceptions
AssertionFailedException

Références $limit, $message, et $value.

Référencé par AndroidSafetyNetAttestationStatementSupport\validatePayload().

◆ lessThan()

static lessThan (   $value,
  $limit,
  $message = null,
string  $propertyPath = null 
)
static

Determines if the value is less than given limit.

Paramètres
mixed$value
mixed$limit
string | callable | null$message
Exceptions
AssertionFailedException

Références $limit, $message, et $value.

◆ max()

static max (   $value,
  $maxValue,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a number is smaller as a given limit.

Paramètres
mixed$value
mixed$maxValue
string | callable | null$message
string | null$propertyPath-assert =numeric $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ maxCount()

static maxCount (   $countable,
  $count,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the countable have at most $count elements.

Paramètres
array | Countable | ResourceBundle | SimpleXMLElement$countable
int$count
string | callable | null$message
Exceptions
AssertionFailedException

Références $count, et $message.

◆ maxLength()

static maxLength (   $value,
  $maxLength,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that string value is not longer than $maxLength chars.

Paramètres
mixed$value
int$maxLength
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ methodExists()

static methodExists (   $value,
  $object,
  $message = null,
string  $propertyPath = null 
)
static

Determines that the named method is defined in the provided object.

Paramètres
string$value
mixed$object
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ min()

static min (   $value,
  $minValue,
  $message = null,
string  $propertyPath = null 
)
static

Assert that a value is at least as big as a given limit.

Paramètres
mixed$value
mixed$minValue
string | callable | null$message
string | null$propertyPath-assert =numeric $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ minCount()

static minCount (   $countable,
  $count,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the countable have at least $count elements.

Paramètres
array | Countable | ResourceBundle | SimpleXMLElement$countable
int$count
string | callable | null$message
Exceptions
AssertionFailedException

Références $count, et $message.

Référencé par TPMAttestationStatementSupport\load(), et PackedAttestationStatementSupport\loadBasicType().

◆ minLength()

static minLength (   $value,
  $minLength,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that a string is at least $minLength chars long.

Paramètres
mixed$value
int$minLength
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ noContent()

static noContent (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is empty.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert empty $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

Référencé par NoneAttestationStatementSupport\load().

◆ notBlank()

static notBlank (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is not blank.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ notContains()

static notContains (   $string,
  $needle,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that string does not contains a sequence of chars.

Paramètres
mixed$string
string$needle
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $string
Renvoie
bool
Exceptions
AssertionFailedException

Références $message.

◆ notEmpty()

static notEmpty (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is not empty.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert !empty $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

Référencé par MetadataStatementFetcher\fetch(), MetadataStatementFetcher\getJwsPayload(), et AndroidSafetyNetAttestationStatementSupport\load().

◆ notEmptyKey()

static notEmptyKey (   $value,
  $key,
  $message = null,
string  $propertyPath = null 
)
static

Assert that key exists in an array/array-accessible object and its value is not empty.

Paramètres
mixed$value
string | int$key
string | callable | null$message
Exceptions
AssertionFailedException

Références $key, $message, et $value.

◆ notEq()

static notEq (   $value1,
  $value2,
  $message = null,
string  $propertyPath = null 
)
static

Assert that two values are not equal (using ==).

Paramètres
mixed$value1
mixed$value2
string | callable | null$message
Exceptions
AssertionFailedException

Références $message.

Référencé par AndroidKeyAttestationStatementSupport\checkAbsenceOfAllApplicationsTag().

◆ notInArray()

static notInArray (   $value,
array  $choices,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is not in array of choices.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ notIsInstanceOf()

static notIsInstanceOf (   $value,
  $className,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is not instance of given class-name.

Paramètres
mixed$value
string$className
string | callable | null$message
string | null$propertyPath-template ExpectedType of object -param class-string<ExpectedType> $className -assert !ExpectedType $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $className, $message, et $value.

◆ notNull()

static notNull (   $value,
  $message = null,
string  $propertyPath = null 
)
static

◆ notRegex()

static notRegex (   $value,
  $pattern,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value does not match a regex.

Paramètres
mixed$value
string$pattern
string | callable | null$message
string | null$propertyPath-assert !=string $value
Exceptions
AssertionFailedException

Références $message, et $value.

◆ notSame()

static notSame (   $value1,
  $value2,
  $message = null,
string  $propertyPath = null 
)
static

Assert that two values are not the same (using ===).

Paramètres
mixed$value1
mixed$value2
string | callable | null$message
string | null$propertyPath-template ExpectedType -param ExpectedType $value2 -assert !=ExpectedType $value1
Renvoie
bool
Exceptions
AssertionFailedException

Références $message.

◆ null()

static null (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is null.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert null $value
Renvoie
bool

Références $message, $value, et null.

◆ numeric()

static numeric (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is numeric.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert numeric $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ objectOrClass()

static objectOrClass (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the value is an object, or a class that exists.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ phpVersion()

static phpVersion (   $operator,
  $version,
  $message = null,
string  $propertyPath = null 
)
static

Assert on PHP version.

Paramètres
string$operator
mixed$version
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $version.

◆ propertiesExist()

static propertiesExist (   $value,
array  $properties,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the value is an object or class, and that the properties all exist.

Paramètres
mixed$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ propertyExists()

static propertyExists (   $value,
  $property,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the value is an object or class, and that the property exists.

Paramètres
mixed$value
string$property
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ range()

static range (   $value,
  $minValue,
  $maxValue,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is in range of numbers.

Paramètres
mixed$value
mixed$minValue
mixed$maxValue
string | callable | null$message
string | null$propertyPath-assert =numeric $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ readable()

static readable (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the value is something readable.

Paramètres
string$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ regex()

static regex (   $value,
  $pattern,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value matches a regex.

Paramètres
mixed$value
string$pattern
string | callable | null$message
string | null$propertyPath-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ same()

static same (   $value,
  $value2,
  $message = null,
string  $propertyPath = null 
)
static

Assert that two values are the same (using ===).

Paramètres
mixed$value
mixed$value2
string | callable | null$message
string | null$propertyPath-template ExpectedType -param ExpectedType $value2 -assert =ExpectedType $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ satisfy()

static satisfy (   $value,
  $callback,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the provided value is valid according to a callback.

If the callback returns false the assertion will fail.

Paramètres
mixed$value
callable$callback
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ scalar()

static scalar (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is a PHP scalar.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert scalar $value
Renvoie
bool
Exceptions
AssertionFailedException

Références $message, et $value.

◆ startsWith()

static startsWith (   $string,
  $needle,
  $message = null,
string  $propertyPath = null,
  $encoding = 'utf8' 
)
static

Assert that string starts with a sequence of chars.

Paramètres
mixed$string
string$needle
string | callable | null$message
string | null$propertyPath
string$encoding-assert =string $string
Renvoie
bool
Exceptions
AssertionFailedException

Références $message.

◆ string()

string (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is a string.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert string $value
Renvoie
bool
Exceptions
AssertionFailedExceptionException to throw when an assertion failed.

Références $message, et $value.

Référencé par SingleMetadata\getMetadataStatement(), AuthenticationExtensionsClientOutputsLoader\load(), PackedAttestationStatementSupport\load(), et PackedAttestationStatementSupport\loadEcdaaType().

◆ stringify()

static stringify (   $value)
staticprotected

Make a string version of a value.

Paramètres
mixed$value

Références $result, $val, $value, elseif, et null.

◆ subclassOf()

static subclassOf (   $value,
  $className,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is subclass of given class-name.

Paramètres
mixed$value
string$className
string | callable | null$message
Exceptions
AssertionFailedException

Références $className, $message, et $value.

◆ true()

◆ uniqueValues()

static uniqueValues ( array  $values,
  $message = null,
string  $propertyPath = null 
)
static

Assert that values in array are unique (using strict equality).

Paramètres
mixed[]$values
string | callable | null$message
Exceptions
AssertionFailedException

Références $key, $message, et $value.

◆ url()

static url (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that value is an URL.

This code snipped was taken from the Symfony project and modified to the special demands of this method.

Paramètres
mixed$value
string | callable | null$message
string | null$propertyPath-assert =string $value
Renvoie
bool
Exceptions
AssertionFailedException
Voir également
https://github.com/symfony/Validator/blob/master/Constraints/UrlValidator.php
https://github.com/symfony/Validator/blob/master/Constraints/Url.php

Références $message, et $value.

◆ uuid()

static uuid (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the given string is a valid UUID.

Uses code from https://github.com/ramsey/uuid that is MIT licensed.

Paramètres
string$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

◆ version()

static version (   $version1,
  $operator,
  $version2,
  $message = null,
string  $propertyPath = null 
)
static

Assert comparison of two versions.

Paramètres
string$version1
string$operator
string$version2
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, $version1, et $version2.

◆ writeable()

static writeable (   $value,
  $message = null,
string  $propertyPath = null 
)
static

Assert that the value is something writeable.

Paramètres
string$value
string | callable | null$message
Exceptions
AssertionFailedException

Références $message, et $value.

Documentation des champs

◆ $exceptionClass

$exceptionClass = InvalidArgumentException::class
staticprotected

◆ INTERFACE_NOT_IMPLEMENTED

const INTERFACE_NOT_IMPLEMENTED = 202

◆ INVALID_ALNUM

const INVALID_ALNUM = 31

◆ INVALID_ARRAY

const INVALID_ARRAY = 24

◆ INVALID_ARRAY_ACCESSIBLE

const INVALID_ARRAY_ACCESSIBLE = 45

◆ INVALID_BASE64

const INVALID_BASE64 = 49

◆ INVALID_BETWEEN

const INVALID_BETWEEN = 219

◆ INVALID_BETWEEN_EXCLUSIVE

const INVALID_BETWEEN_EXCLUSIVE = 220

◆ INVALID_BOOLEAN

const INVALID_BOOLEAN = 13

◆ INVALID_CALLABLE

const INVALID_CALLABLE = 215

◆ INVALID_CHOICE

const INVALID_CHOICE = 22

◆ INVALID_CLASS

const INVALID_CLASS = 105

◆ INVALID_CONSTANT

const INVALID_CONSTANT = 221

◆ INVALID_COUNT

const INVALID_COUNT = 41

◆ INVALID_COUNTABLE

const INVALID_COUNTABLE = 226

◆ INVALID_DATE

const INVALID_DATE = 214

◆ INVALID_DIGIT

const INVALID_DIGIT = 11

◆ INVALID_DIRECTORY

const INVALID_DIRECTORY = 101

◆ INVALID_E164

const INVALID_E164 = 48

◆ INVALID_EMAIL

const INVALID_EMAIL = 201

◆ INVALID_EQ

const INVALID_EQ = 33

◆ INVALID_EXTENSION

const INVALID_EXTENSION = 222

◆ INVALID_FALSE

const INVALID_FALSE = 38

◆ INVALID_FILE

const INVALID_FILE = 102

◆ INVALID_FILE_NOT_EXISTS

const INVALID_FILE_NOT_EXISTS = 107

◆ INVALID_FLOAT

const INVALID_FLOAT = 9

◆ INVALID_GREATER

const INVALID_GREATER = 212

◆ INVALID_GREATER_OR_EQUAL

const INVALID_GREATER_OR_EQUAL = 213

◆ INVALID_INSTANCE_OF

const INVALID_INSTANCE_OF = 28

◆ INVALID_INTEGER

const INVALID_INTEGER = 10

◆ INVALID_INTEGERISH

const INVALID_INTEGERISH = 12

◆ INVALID_INTERFACE

const INVALID_INTERFACE = 106

◆ INVALID_IP

const INVALID_IP = 218

◆ INVALID_JSON_STRING

const INVALID_JSON_STRING = 206

◆ INVALID_KEY_EXISTS

const INVALID_KEY_EXISTS = 26

◆ INVALID_KEY_ISSET

const INVALID_KEY_ISSET = 46

◆ INVALID_KEY_NOT_EXISTS

const INVALID_KEY_NOT_EXISTS = 216

◆ INVALID_LENGTH

const INVALID_LENGTH = 37

◆ INVALID_LESS

const INVALID_LESS = 210

◆ INVALID_LESS_OR_EQUAL

const INVALID_LESS_OR_EQUAL = 211

◆ INVALID_MAX

const INVALID_MAX = 36

◆ INVALID_MAX_COUNT

const INVALID_MAX_COUNT = 228

◆ INVALID_MAX_LENGTH

const INVALID_MAX_LENGTH = 19

◆ INVALID_METHOD

const INVALID_METHOD = 208

◆ INVALID_MIN

const INVALID_MIN = 35

◆ INVALID_MIN_COUNT

const INVALID_MIN_COUNT = 227

◆ INVALID_MIN_LENGTH

const INVALID_MIN_LENGTH = 18

◆ INVALID_NOT_BLANK

const INVALID_NOT_BLANK = 27

◆ INVALID_NOT_EQ

const INVALID_NOT_EQ = 42

◆ INVALID_NOT_INSTANCE_OF

const INVALID_NOT_INSTANCE_OF = 204

◆ INVALID_NOT_REGEX

const INVALID_NOT_REGEX = 50

◆ INVALID_NOT_SAME

const INVALID_NOT_SAME = 43

◆ INVALID_NUMERIC

const INVALID_NUMERIC = 23

◆ INVALID_OBJECT

const INVALID_OBJECT = 207

◆ INVALID_PROPERTY

const INVALID_PROPERTY = 224

◆ INVALID_RANGE

const INVALID_RANGE = 30

◆ INVALID_READABLE

const INVALID_READABLE = 103

◆ INVALID_REGEX

const INVALID_REGEX = 17

◆ INVALID_RESOURCE

const INVALID_RESOURCE = 225

◆ INVALID_SAME

const INVALID_SAME = 34

◆ INVALID_SATISFY

const INVALID_SATISFY = 217

◆ INVALID_SCALAR

const INVALID_SCALAR = 209

◆ INVALID_STRING

const INVALID_STRING = 16

◆ INVALID_STRING_CONTAINS

const INVALID_STRING_CONTAINS = 21

◆ INVALID_STRING_END

const INVALID_STRING_END = 39

◆ INVALID_STRING_NOT_CONTAINS

const INVALID_STRING_NOT_CONTAINS = 229

◆ INVALID_STRING_START

const INVALID_STRING_START = 20

◆ INVALID_SUBCLASS_OF

const INVALID_SUBCLASS_OF = 29

◆ INVALID_TRAVERSABLE

const INVALID_TRAVERSABLE = 44

◆ INVALID_TRUE

const INVALID_TRUE = 32

◆ INVALID_UNIQUE_VALUES

const INVALID_UNIQUE_VALUES = 230

◆ INVALID_URL

const INVALID_URL = 203

◆ INVALID_UUID

const INVALID_UUID = 40

◆ INVALID_VALUE_IN_ARRAY

const INVALID_VALUE_IN_ARRAY = 47

◆ INVALID_VERSION

const INVALID_VERSION = 223

◆ INVALID_WRITEABLE

const INVALID_WRITEABLE = 104

◆ VALUE_EMPTY

const VALUE_EMPTY = 14

◆ VALUE_NOT_EMPTY

const VALUE_NOT_EMPTY = 205

◆ VALUE_NOT_NULL

const VALUE_NOT_NULL = 25

◆ VALUE_NULL

const VALUE_NULL = 15

La documentation de cette classe a été générée à partir du fichier suivant :