Webmozart\Assert\InvalidArgumentException
Assert::positiveInteger()
all*()
and nullOr*()
methods to improve psalm compatibility.all*
& nullOr*
methods@psalm-pure
annotation to Assert::notFalse()
@psalm-assert
annotations where appropriateall*
& nullOr*
methods are now declared on an interface, instead of @method
annotations.
This interface is linked to the Assert
class with a @mixin
annotation. Most IDE's have supported this
for a long time, and you should not lose any autocompletion capabilities. PHPStan has supported this since
version 0.12.20
. This package is marked incompatible (with a composer conflict) with phpstan version prior to that.
If you do not use PHPStan than this does not matter.Assert::notStartsWith()
Assert::notEndsWith()
Assert::inArray()
@psalm-pure
annotations to pure assertionsDateTime(Immutable)
objects now display their date & time.Assert::count()
now use the values to render the exception message.Assert::notFalse()
Assert::isAOf()
Assert::isAnyOf()
Assert::isNotA()
Assert::validArrayKey()
Assert::isNonEmptyList()
Assert::isNonEmptyMap()
@throws InvalidArgumentException
annotations to all methods that throw.@psalm-assert
for the list type to the isList
assertion.ResourceBundle
& SimpleXMLElement
now pass the isCountable
assertions.
They are countable, without implementing the Countable
interface.range
now has the proper variables.isList
and isMap
. As it is a valid form of both.
If a non-empty variant is needed, use isNonEmptyList
or isNonEmptyMap
.@psalm-assert
annotations, that were 'side effect' assertions See:
3.6.0
. Which is enforced through a composer conflict.
If you don't use Psalm, then this has no impact.Assert::uniqueValues()
Assert::unicodeLetters()
Assert::email()
@psalm-assert
annotations where appropriate.Assert::endsWith()
would not give the correct result when dealing with a multibyte suffix.Assert::length(), minLength, maxLength, lengthBetween
would not give the correct result when dealing with multibyte characters.NOTE: These 2 changes may break your assertions if you relied on the fact that multibyte characters didn't behave correctly.
Assert::isTraversable()
in favor of Assert::isIterable()
trigger_error
. It is now annotated as well.Assert::ip()
Assert::ipv4()
Assert::ipv6()
Assert::notRegex()
Assert::interfaceExists()
Assert::isList()
Assert::isMap()
__toString()
Assert::minCount()
Assert::maxCount()
Assert::countBetween()
Assert::isCountable()
Assert::notWhitespaceOnly()
Assert::natural()
Assert::notContains()
Assert::isArrayAccessible()
Assert::isInstanceOfAny()
Assert::isIterable()
stringNotEmpty
will no longer report "0" is an empty stringAssert::isTraversable()
in favor of Assert::isIterable()
Assert::throws()
Assert::count()
Assert::reportInvalidArgument()
for custom subclassesAssert::object()
Assert::propertyExists()
Assert::propertyNotExists()
Assert::methodExists()
Assert::methodNotExists()
Assert::uuid()