# beberlei/assert

PHP library of assertions and guard methods for input validation.


Source: https://findsoftware.frbit.cloud/beberlei-assert/
Last reviewed: 2026-11-04
Listed since: 2026-11-04

## Record

### Links

- repository: https://github.com/beberlei/assert
- docs: https://github.com/beberlei/assert/blob/master/README.md

### Identity

- status: active
- maintainer: Benjamin Eberlei
- maintainerType: individual
- parent: unknown
- firstRelease: 2012
- hqCountry: unknown

### Kind

- category: library
- hosting: php
- language: php
- runtime: php
- runtimeMin: php 7.1
- basedOn: unknown

### Content

- contentStore: not applicable
- databases: not applicable
- adminUi: not applicable
- headlessApi: not applicable
- templating: not applicable
- i18n: not applicable

### Rendering and deploy

- runsAs: not applicable
- renderingModes: not applicable
- installMethod: composer require beberlei/assert

### License

- licenseModel: open-source
- license: BSD-2-Clause

### Releases

- currentMajor: 3
- latestReleaseDate: 2026-06-10

### Adoption

- githubStargazers: 2426
- packagistDownloads: 110672846
- npmWeeklyDownloads: not applicable
- contributors: 69
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 4626
- dependentPackages: 667

### Sources

- urls: https://api.github.com/repos/beberlei/assert (read 2026-11-04)
- urls: https://github.com/beberlei/assert/blob/master/README.md (read 2026-11-04)
- firstRelease: https://api.github.com/repos/beberlei/assert/tags (read 2026-11-04)
- maintainer: https://github.com/beberlei/assert/blob/master/LICENSE (read 2026-11-04)
- language: https://api.github.com/repos/beberlei/assert (read 2026-11-04)
- runtime: https://github.com/beberlei/assert/blob/v3.3.4/composer.json (read 2026-11-04)
- runtimeMin: https://github.com/beberlei/assert/blob/v3.3.4/composer.json (read 2026-11-04)
- category: https://github.com/beberlei/assert/blob/master/README.md (read 2026-11-04)
- installMethod: https://github.com/beberlei/assert/blob/master/README.md (read 2026-11-04)
- license: https://github.com/beberlei/assert/blob/v3.3.4/composer.json (read 2026-11-04)
- currentMajor: https://api.github.com/repos/beberlei/assert/releases (read 2026-11-04)
- latestReleaseDate: https://api.github.com/repos/beberlei/assert/releases/latest (read 2026-11-04)
- githubStargazers: https://api.github.com/repos/beberlei/assert (read 2026-11-04)
- contributors: https://api.github.com/repos/beberlei/assert/contributors (read 2026-11-04)
- packagistDownloads: https://packagist.org/packages/beberlei/assert.json (read 2026-11-04)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/beberlei%2Fassert (read 2026-11-04)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/beberlei%2Fassert (read 2026-11-04)

## Notes

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.

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
