{"meta":{"name":"FindSoftware","page":"https://findsoftware.frbit.cloud/beberlei-assert/","markdown":"https://findsoftware.frbit.cloud/beberlei-assert.md","license":"https://creativecommons.org/licenses/by/4.0/","attribution":"FindSoftware, CC BY 4.0","note":"Attributes are recorded, never scored. An absent field means unknown, never zero and never bad."},"record":{"id":"beberlei-assert","name":"beberlei/assert","urls":{"repository":"https://github.com/beberlei/assert","docs":"https://github.com/beberlei/assert/blob/master/README.md"},"category":["library"],"description":"PHP library of assertions and guard methods for input validation.","maintainer":"Benjamin Eberlei","maintainerType":"individual","firstRelease":2012,"hosting":["php"],"language":"php","runtime":["php"],"runtimeMin":"php 7.1","contentStore":null,"databases":null,"adminUi":null,"headlessApi":null,"templating":null,"i18n":null,"runsAs":null,"renderingModes":null,"installMethod":"composer require beberlei/assert","licenseModel":"open-source","license":"BSD-2-Clause","currentMajor":"3","latestReleaseDate":"2026-06-10T00:00:00.000Z","githubStargazers":2426,"contributors":69,"packagistDownloads":110672846,"npmWeeklyDownloads":null,"dependentRepos":4626,"dependentPackages":667,"checkedAt":"2026-11-04T00:00:00.000Z","addedAt":"2026-11-04T00:00:00.000Z","sources":[{"field":"urls","url":"https://api.github.com/repos/beberlei/assert","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"urls","url":"https://github.com/beberlei/assert/blob/master/README.md","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"firstRelease","url":"https://api.github.com/repos/beberlei/assert/tags","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"maintainer","url":"https://github.com/beberlei/assert/blob/master/LICENSE","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"language","url":"https://api.github.com/repos/beberlei/assert","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"runtime","url":"https://github.com/beberlei/assert/blob/v3.3.4/composer.json","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"runtimeMin","url":"https://github.com/beberlei/assert/blob/v3.3.4/composer.json","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"category","url":"https://github.com/beberlei/assert/blob/master/README.md","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"installMethod","url":"https://github.com/beberlei/assert/blob/master/README.md","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"license","url":"https://github.com/beberlei/assert/blob/v3.3.4/composer.json","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"currentMajor","url":"https://api.github.com/repos/beberlei/assert/releases","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"latestReleaseDate","url":"https://api.github.com/repos/beberlei/assert/releases/latest","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"githubStargazers","url":"https://api.github.com/repos/beberlei/assert","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"contributors","url":"https://api.github.com/repos/beberlei/assert/contributors","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"packagistDownloads","url":"https://packagist.org/packages/beberlei/assert.json","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"dependentPackages","url":"https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/beberlei%2Fassert","checkedAt":"2026-11-04T00:00:00.000Z"},{"field":"dependentRepos","url":"https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/beberlei%2Fassert","checkedAt":"2026-11-04T00:00:00.000Z"}],"status":"active","ai":"authored"},"prose":"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."}