Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Assert Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v3.3.3

What's Changed

New Contributors

Full Changelog: https://github.com/beberlei/assert/compare/v3.3.2...v3.3.3

v3.3.2

What's Changed

New Contributors

Full Changelog: https://github.com/beberlei/assert/compare/v3.3.1...v3.3.2

v3.3.0-beta1
  • #302 PHP 8 support thanks to @ptondereau
  • #304 Migrate from TravisCI to Github Actions
  • #296 Add Assert::uniqueValues thanks to @gronostajo
v3.2.7

3.2.7 - 2019-12-19

Fixes

  • Reinstated the [@method](https://github.com/method) return type for Assert\LazyAssertion methods to show that the return type is LazyAssertion.
v3.2.6

3.2.6 - 2019-10-10

Fixes

  • Make Assert\Assertion::stringify() UTF-8 safe (Thanks to Pedram Azimaei)
v3.2.5

3.2.5 - 2019-10-10 - Fix the broken things release.

Notice

  • Sigh!
    • Richard Quadling

Fixes

  • REALLY Removed dependency of the intl extension.
  • Updated the Docblocks for Assert\Assertion::all() helper to show that the value is expected to be an array.
v3.2.4

3.2.4 - 2019-10-09 - Fix the broken things release.

Notice

  • It seems I've been slightly lax in verifying the signature changes and expected extensions. Hopefully, both of these have been fixed in this version. Truly sorry for breaking the internet!
    • Richard Quadling

Fixes

  • Restored \Assert\Assertion::createException() signature to 3.2.2.
  • Removed dependency of the intl extension. If the extension is available, then Assert\Assertion::count(), Assert\Assertion::isCountable(), Assert\Assertion::minCount(), and Assert\Assertion::maxCount() will operate on ResourceBundles.
  • Fixed the [@method](https://github.com/method) return type for Assert\LazyAssertion methods to show that the return type is static for extensions of Assert\LazyAssertion.
    NOTE : Docblock does not have the ability to differentiate between a non static [@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.
v3.2.3

3.2.3 - 2019-08-23

Other changes

  • Added type hints and documentation consistency (Thanks to Andru Cherny)
v3.2.2

3.2.2 - 2019-08-23

Added assertions

v2.9.9

2.9.9 - 2019-05-28

Other changes

  • Removed version number from composer.json to allow tag to provide version number
v3.2.1

3.2.1 - 2019-05-28

Fixes

Other changes

  • Added PHP 7.3.0, PHP 7.3.1, and PHP 7.3.2 to Travis pipeline as there are differences in PCRE
  • Updated docblocks for Assert\Assertion::NullOrXxxx() to show that the first parameter can be null.
  • Updated docblocks for Assert\LazyAssertion to show that the return type is $this to aid IDE's static analysis.
v2.9.8

2.9.8 - 2019-05-28

Fixes

Includes unreleased :

  • Fixed broken regex for Assert\Assertion::url() (Thanks to Menno Holtkamp)
v3.2.0

3.2.0 - 2018-12-24

Added assertions

Other changes

  • Added PHP 7.3 to Travis pipeline
  • Added support for \ResourceBundle and \SimpleXMLElement to Assertion::count().
v3.1.0

3.1.0 - 2018-10-29

Other changes

  • Refactor assertion messages for Assert\Assertion::notEq(), Assert\Assertion::notSame(), and Assert\Assertion::notInArray() (Thanks to Rick Kuipers)
v3.0.1

3.0.1 - 2018-07-04

Added assertions

v3.0.0

3.0.0 - 2018-07-04

Changes

  • Deprecate support for PHP < 7.0

Fixes

  • An AssertionFailedException must be a Throwable (Thanks to Marco Pivetta)
v2.9.6

2.9.6 - 2018-04-16

Fixes

  • Made constraints in exceptions consistent for all assertions (Thanks to Peter Kruithof)
v2.9.5

2.9.5 - 2018-04-16

Fixes

  • Remove DocBlock entry causing exception in third party DocBlock parser (Thanks to Koutsoumpos Valantis)
v2.9.4

2.9.4 - 2018-04-09

Fixes

  • Prevent date overflow in Assertion::date() by reset preset date value (Thanks to Nobuhiro Nakamura)
v2.9.3

2.9.3 - 2018-03-16

Changes

  • Expand error for \Assert\Assertion::count() to include the supplied count (Thanks to Yoann Blot)
v2.9.2

2.9.2 - 2018-01-25

Fixes

  • Usage of custom extended Assertion class in LazyAssertion (Thanks to Marek Štípek)
v2.9.1

2.9.1 - 2018-01-25

Deprecation notice

  • Support for PHP 5 will be dropped at the end of 2018, in line with PHP's supported versions.

Fixes

  • \Assert\Assertion::generateMessage() will now receive the default message for an assertion if one is not supplied (Thanks to Romans Malinovskis)
v2.8.1

2.8.1 - 2017-11-30

Fixes

  • Assertion::integerish() has had several issues in the last couple of versions.
    Hopefully these are now fixed. Thanks to Erik Roelofs and Michał Mleczko

Deprecation notice

  • The functions \Assert\that(), \Assert\thatAll(), \Assert\thatNullOr(), and \Assert\lazy() are no longer marked as deprecated.
    Both the functional and static constructors work together. Whichever you wish to use is a personal preference.
v2.7.11

2.7.11 - 2017-11-13

Fixes

  • Assertion::integerish(0) and Assertion::integerish('0') now assert correctly.
v2.7.10

2.7.10 - 2017-11-13

Added assertions

v2.7.9

2.7.9 - 2017-11-13

Fixes

  • Assertion::integerish([]) now correctly asserts integers with leading zeros in strings (Thank to Albert Casademont)
v2.7.8

2.7.8 - 2017-10-20

Fixes

  • Assertion::integerish([]) now throws exception as expected (Thank to Thomas Flack)
v2.7.7

2.7.7 - 2017-10-18

Fixes

  • Basic Auth usernames and passwords can contain '.' (Thank to Fede Isas)
v2.7.6

2.7.6 - 2017-05-04

Fixes

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport