Download the PHP package phpstan/phpstan-webmozart-assert without Composer
On this page you can find all versions of the php package phpstan/phpstan-webmozart-assert. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpstan/phpstan-webmozart-assert
More information about phpstan/phpstan-webmozart-assert
Files in phpstan/phpstan-webmozart-assert
Package phpstan-webmozart-assert
Short Description PHPStan webmozart/assert extension
License MIT
Informations about the package phpstan-webmozart-assert
PHPStan webmozart/assert extension
Description
The main scope of this extension is to help PHPStan to detect the type of object after the Webmozart\Assert\Assert validation.
Supported assertions
This extension understands the following Assert::* methods and narrows types accordingly.
All assertions also work with the nullOr*(), all*(), and allNullOr*() prefixes (e.g. Assert::nullOrString(), Assert::allInteger(), Assert::allNullOrNotEmpty()).
Type checks
integer, positiveInteger, natural, float, numeric, integerish, boolean, scalar, string, stringNotEmpty, object, resource, isCallable, isArray, isIterable, isTraversable, isList, isNonEmptyList, isMap, isNonEmptyMap, isCountable, isArrayAccessible
Instance and class checks
isInstanceOf, isInstanceOfAny, notInstanceOf, isAOf, isAnyOf, isNotA, subclassOf, implementsInterface, classExists, interfaceExists
Comparison
same, notSame, eq, notEq, greaterThan, greaterThanEq, lessThan, lessThanEq, range, true, false, null, notNull, notFalse, inArray, oneOf
String assertions
contains, startsWith, endsWith, startsWithLetter, unicodeLetters, alpha, digits, alnum, lower, upper, uuid, ip, ipv4, ipv6, email, notWhitespaceOnly, length, minLength, maxLength, lengthBetween
Count assertions
count, minCount, maxCount, countBetween
Object and array
keyExists, keyNotExists, validArrayKey, methodExists, propertyExists
Negative all* assertions
allNotNull, allNotInstanceOf, allNotSame
Installation
To use this extension, require it in Composer:
If you also install phpstan/extension-installer then you're all set!