beberlei/assert
PHP library of assertions and guard methods for input validation.
beberlei/assert is a PHP library of assertions and guard methods for checking input. Each assertion, such as Assertion::integer() or Assertion::notEmpty(), throws an exception when the value does not hold, so the code does not need an if-clause for the same condition. The library validates input and does not filter it. A fluent Assert::that() API chains several checks on one value, and lazy assertions collect every failure and throw one combined exception. A project can subclass the assertion class to change the exception it throws and to add its own assertions.
Identity
- Status
- Active
- Maintainer
- Benjamin Eberlei4
- Maintained by
- Individual
- First release
- 20123
Rendering and deploy
- Install with
- composer require beberlei/assert2
Releases
Adoption
Sources
- 2026-11-04: links, Written in, GitHub stars
api.github.com/repos/beberlei/assert - 2026-11-04: links, Categories, Install with
github.com/beberlei/assert/blob/master/README.md - 2026-11-04: First release
api.github.com/repos/beberlei/assert/tags - 2026-11-04: Maintainer
github.com/beberlei/assert/blob/master/LICENSE - 2026-11-04: Runtime, Minimum runtime, License
github.com/beberlei/assert/blob/v3.3.4/composer.json - 2026-11-04: Current major version
api.github.com/repos/beberlei/assert/releases - 2026-11-04: Last release
api.github.com/repos/beberlei/assert/releases/latest - 2026-11-04: Contributors
api.github.com/repos/beberlei/assert/contributors - 2026-11-04: Packagist downloads
packagist.org/packages/beberlei/assert.json - 2026-11-04: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/packagist.org/packages/beberlei%2Fassert