beberlei/assert
Lightweight assertion library for validating method arguments and input data in PHP. Provides a fluent, readable API with many built-in rules (string, numeric, email, UUID, collection, etc.), clear exceptions, and easy extensibility for custom constraints.
.github/ export-ignore to .gitattributes by @TimWolla in https://github.com/beberlei/assert/pull/326Full Changelog: https://github.com/beberlei/assert/compare/v3.3.2...v3.3.3
Full Changelog: https://github.com/beberlei/assert/compare/v3.3.1...v3.3.2
Assert::uniqueValues thanks to @gronostajo[@method](https://github.com/method) return type for Assert\LazyAssertion methods to show that the return type is LazyAssertion.Assert\Assertion::all() helper to show that the value is expected to be an array.\Assert\Assertion::createException() signature to 3.2.2.Assert\Assertion::count(), Assert\Assertion::isCountable(), Assert\Assertion::minCount(), and Assert\Assertion::maxCount() will operate on ResourceBundles.[@method](https://github.com/method) return type for Assert\LazyAssertion methods to show that the return type is static for extensions of Assert\LazyAssertion.[@method](https://github.com/method) whose returns type is of the subclass and a [@method](https://github.com/method) that is called statically (PSR-5#899). So the use of static static is a fudge that sort of works for IDEs that need to know about the method that MAY be overridden in a subclass.Assert\Assertion::url() (Thanks to Christophe Histaesse)Assert\Assertion::url() (Thanks to Menno Holtkamp)Assert\Assertion::NullOrXxxx() to show that the first parameter can be null.Assert\LazyAssertion to show that the return type is $this to aid IDE's static analysis.Assert\Assertion::url() (Thanks to Christophe Histaesse)Includes unreleased :
Assert\Assertion::url() (Thanks to Menno Holtkamp)Assertion::isCountable() (Thanks to Baptiste Clavié)Assertion::maxCount() (Thanks to Baptiste Clavié)Assertion::minCount() (Thanks to Baptiste Clavié)Assertion::nonContains() (Thanks to Baptiste Clavié)\ResourceBundle and \SimpleXMLElement to Assertion::count().Assert\Assertion::notEq(), Assert\Assertion::notSame(), and Assert\Assertion::notInArray() (Thanks to Rick Kuipers)AssertionFailedException must be a Throwable (Thanks to Marco Pivetta)\Assert\Assertion::count() to include the supplied count (Thanks to Yoann Blot)\Assert\Assertion::generateMessage() will now receive the default message for an assertion if one is not supplied (Thanks to Romans Malinovskis)Assertion::integerish() has had several issues in the last couple of versions.\Assert\that(), \Assert\thatAll(), \Assert\thatNullOr(), and \Assert\lazy() are no longer marked as deprecated.Assertion::integerish(0) and Assertion::integerish('0') now assert correctly.Assertion::integerish([]) now correctly asserts integers with leading zeros in strings (Thank to Albert Casademont)Assertion::integerish([]) now throws exception as expected (Thank to Thomas Flack)How can I help you explore Laravel packages today?