PackageTrack
Sign in Get early access

beberlei/assert

Thin assertion library for input validation in business models.

v3.3.4 105M downloads/mo #493 most downloaded on Packagist beberlei/assert

What this package is like to depend on

Last release 2 months ago

10 Jun 2026

Release timing varies

gaps range from 2 weeks to 2.6 years

Most releases are documented

notes for 45 of 62 stable releases

Nothing withdrawn

no release was ever pulled

14 years old

63 releases · first in 2012

1 release in the last 12 months

see the full history below

Release timeline

63 releases · May 2012 to Jun 2026
2013 2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 60 of 63
  1. v3.3.4 10 Jun 2026
    Release notes

    What's Changed

    Full Changelog: v3.3.3...v3.3.4

    Open source →
  2. v3.3.3 15 Jul 2024
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v3.3.2...v3.3.3

    Open source →
  3. v3.3.2 16 Dec 2021
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v3.3.1...v3.3.2

    Open source →
  4. v3.3.1 18 Apr 2021
    Release notes Open source →
  5. v3.3.0 13 Nov 2020

    Nothing published for this version

  6. v3.3.0-beta1 13 Nov 2020 pre-release
    Release notes
    Open source →
  7. v3.2.7 19 Dec 2019
    Release notes

    3.2.7 - 2019-12-19

    Fixes

    • Reinstated the @method return type for Assert\LazyAssertion methods to show that the return type is LazyAssertion.
    Open source →
    Release notes

    Fixes

    • Reinstated the @method return type for Assert\LazyAssertion methods to show that the return type is LazyAssertion.
    Open source →
  8. v3.2.6 10 Oct 2019
    Release notes

    3.2.6 - 2019-10-10

    Fixes

    • Make Assert\Assertion::stringify() UTF-8 safe (Thanks to Pedram Azimaei)
    Open source →
    Release notes

    Fixes

    • Make Assert\Assertion::stringify() UTF-8 safe (Thanks to Pedram Azimaei)
    Open source →
  9. v3.2.5 10 Oct 2019
    Release notes

    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.
    Open source →
    Release notes

    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.
    Open source →
  10. v3.2.4 10 Oct 2019
    Release notes

    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 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 whose returns type is of the subclass and a @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.
    Open source →
    Release notes

    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 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 whose returns type is of the subclass and a @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.
    Open source →
  11. v3.2.3 23 Aug 2019
    Release notes

    Other changes

    • Added type hints and documentation consistency (Thanks to Andru Cherny)
    Open source →
  12. v3.2.2 23 Aug 2019
    Release notes

    Added assertions

    Open source →
  13. v3.2.1 28 May 2019
    Release notes

    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.
    Open source →
  14. v3.2.0 24 Dec 2018
    Release notes

    Added assertions

    Other changes

    • Added PHP 7.3 to Travis pipeline
    • Added support for \ResourceBundle and \SimpleXMLElement to Assertion::count().
    Open source →
  15. v3.1.0 29 Oct 2018
    Release notes

    Other changes

    • Refactor assertion messages for Assert\Assertion::notEq(), Assert\Assertion::notSame(), and Assert\Assertion::notInArray() (Thanks to Rick Kuipers)
    Open source →
  16. v3.0.1 11 Oct 2018
    Release notes

    Added assertions

    Other changes

    • Upgraded regex and unit tests for Assert\Assertion::url() to latest from Symfony/Validator
    Open source →
  17. v3.0.0 04 Jul 2018
    Release notes

    Changes

    • Deprecate support for PHP < 7.0

    Fixes

    • An AssertionFailedException must be a Throwable (Thanks to Marco Pivetta)
    Open source →
  18. v2.9.9 28 May 2019

    Nothing published for this version

  19. v2.9.6 11 Jun 2018
    Release notes

    Fixes

    • Made constraints in exceptions consistent for all assertions (Thanks to Peter Kruithof)
    Open source →
  20. v2.9.5 16 Apr 2018
    Release notes

    Fixes

    • Remove DocBlock entry causing exception in third party DocBlock parser (Thanks to Koutsoumpos Valantis)
    Open source →
  21. v2.9.4 09 Apr 2018
    Release notes

    Fixes

    • Prevent date overflow in Assertion::date() by reset preset date value (Thanks to Nobuhiro Nakamura)
    Open source →
  22. v2.9.3 16 Mar 2018
    Release notes

    Changes

    • Expand error for \Assert\Assertion::count() to include the supplied count (Thanks to Yoann Blot)
    Open source →
  23. v2.9.2 25 Jan 2018
    Release notes

    Fixes

    • Usage of custom extended Assertion class in LazyAssertion (Thanks to Marek Štípek)
    Open source →
  24. v2.9.1 25 Jan 2018
    Release notes

    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)
    Open source →
  25. v2.8.1 30 Nov 2017
    Release notes

    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.
    Open source →
  26. v2.7.11 13 Nov 2017
    Release notes

    Fixes

    • Assertion::integerish(0) and Assertion::integerish('0') now assert correctly.
    Open source →
  27. v2.7.10 13 Nov 2017
    Release notes

    Added assertions

    Open source →
  28. v2.7.9 13 Nov 2017
    Release notes

    Fixes

    • Assertion::integerish() now correctly asserts integers with leading zeros in strings (Thanks to Albert Casademont)
    Open source →
  29. v2.7.8 20 Oct 2017
    Release notes

    Fixes

    • Assertion::integerish() now throws exception as expected (Thanks to Thomas Flack)
    Open source →
  30. v2.7.7 18 Oct 2017
    Release notes

    Fixes

    • Basic Auth usernames and passwords can contain '.' (Thanks to Fede Isas)
    Open source →
  31. v2.7.6 04 May 2017
    Release notes

    Fixes

    Open source →
  32. v2.7.5 26 Apr 2017
    Release notes

    Added assertions

    Other changes

    • Corrected doc-block for Assert\Assertion::propertiesExist().
    Open source →
  33. v2.7.4 14 Mar 2017
    Release notes

    Added assertions

    Other changes

    • Unit tests no longer using deprecated exception methods (Thanks to Richard Quadling)
    • All global namespaced functions have been optimised (Thanks to Andreas Möller)
    Open source →
  34. v2.7.3 24 Jan 2017
    Release notes

    Fixes

    • Fix Assert\Assertion::integerish() when used with a resource (Thanks to manuxi)
    Open source →
  35. v2.7.2 09 Jan 2017
    Release notes

    Fixes

    • Backward compatibility fixes for PHP 5.3
    Open source →
  36. v2.7.1 06 Jan 2017
    Release notes

    Added assertions

    Other changes

    • Exception messages can now be constructed via a callback.
    • Documentation now includes types.
    Open source →
  37. v2.6.9 04 Jan 2017
    Release notes

    Added assertions

    Other changes

    • Added types to generated documentation.
    • Added PHPStan analysis for PHP 7+
    Open source →
  38. v2.6.8 05 Dec 2016
    Release notes

    Fixes

    • All exceptions thrown by this library extend \Assert\InvalidArgumentException (Thanks to Richard Quadling)

    Other changes

    Open source →
  39. v2.6.7 14 Nov 2016
    Release notes

    Fixes

    Other changes

    Deprecation notice

    • The functions in the Assert namespace (\Assert\that(), \Assert\thatAll(), \Assert\thatNullOr() and \Assert\lazy()) are now marked as deprecated. They will be removed in the next major release. They have been replaced with the static methods \Assert\Assert::that(), \Assert\Assert::thatAll(), \Assert\Assert::thatNullOr() and \Assert\Assert::lazy()
    Open source →
  40. v2.6.6 31 Oct 2016
    Release notes Open source →
  41. 2.6.5 11 Oct 2016
    Release notes

    Added assertions

    • Assert\Assertion::between()
    • Assert\Assertion::betweenExclusive()

    Fixes

    Other changes

    • Upgraded regex and unit tests for Assert\Assertion::url() to latest from Symfony/Validator
    • Added PHP-CS
    • Speed up of builds for Travis
    Open source →
  42. v2.6.4 03 Oct 2016
    Release notes

    Added assertions

    • Assert\Assertion::e164() - The international public telecommunication numbering plan
    • Assert\Assertion::interfaceExists()
    • Assert\Assertion::ip() / Assert\Assertion::ipv4() / Assert\Assertion::ipv6()
    • Assert\Assertion::keyNotExists()
    • Assert\Assertion::null()
    • Assert\Assertion::satisfy() - Allows for a bespoke assertion, rather than a predefined one

    Fixes

    • Improved the reporting of the value for min and max assertions

    Other changes

    • Removed composer.lock file from library
    • Improved travis build to detect incorrect documentation changes
    Open source →
  43. v2.6.3 28 Jul 2016
    Release notes

    Added assertions

    • Assert\Assertion::notInArray()

    Fixes

    • Made Assert\Assertion::INVALID_GREATER_OR_EQUAL unique

    Other changes

    • Introduced CONTRIBUTING.md to get contributors to generate the docblocks when a new assertion is added
    • Introduced .editorconfig to allow IDEs that support EditorConfig to provide a consistent code style. See EditorConfig for further details
    • Additional tests and updated documentation.
    • Travis updates.
    Open source →
  44. v2.6.2 26 Jul 2016
    Release notes

    Fixes

    • Fixed unit test to work with PHP 5.3
    Open source →
  45. v2.6.1 26 Jul 2016
    Release notes

    Fixes

    • Fixed Assertion::isCallable() to with with PHP 5.3
    Open source →
  46. v2.5.2 25 Jul 2016
    Release notes

    Other changes

    • Updated tests
    • Updated generate_method_docs.php and regenerated all documentation
    • Added Richard Quadling as collaborator
    Open source →
  47. v2.5.1 20 Jun 2016
    Release notes

    Other changes

    • Updated missing assertions from documentation
    Open source →
  48. v2.0.1 26 Jan 2014
    Release notes

    Other changes

    • Pass constraints and values to Assert\AssertionFailedException
    Open source →
  49. v2.6 26 Jul 2016

    Nothing published for this version

  50. v2.5 22 Mar 2016

    Nothing published for this version

  51. v2.4 21 Aug 2015

    Nothing published for this version

  52. v2.3 18 Dec 2014

    Nothing published for this version

  53. v2.2 18 Dec 2014

    Nothing published for this version

  54. v2.1 06 Nov 2014

    Nothing published for this version

  55. v2.0 26 Jan 2014

    Nothing published for this version

  56. v1.7 25 Jan 2014

    Nothing published for this version

  57. v1.6 05 Nov 2013

    Nothing published for this version

  58. v1.5 01 Oct 2013

    Nothing published for this version

  59. v1.4 07 Jul 2013

    Nothing published for this version

  60. v1.3 02 Feb 2013

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive