# beberlei/assert

Thin assertion library for use in libraries and business-model

Repository: https://github.com/beberlei/assert
Canonical: https://ross.abutalabs.com/products/beberlei-assert
Language: PHP
License: NOASSERTION
License Family: other
Last push: 2026-06-10T19:57:39+00:00

## Health v2 (maintenance only)
Score: 78/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 86, release rhythm 55, longevity 100
- inputs: {"age_days": 5218, "days_push": 84, "days_rel": 84, "gap_med": 588, "n_releases_24m": 2}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2432, forks 187 (observed 2026-08-28T04:06:51.162140+00:00)

## What it is
A thin PHP assertion library providing assertions and guard methods for input validation in business models, libraries, and low-level application code. Failed assertions throw exceptions, eliminating the need for verbose if-clause validation code.

## Use cases
- validate function arguments in php
- assert preconditions in business model
- throw exception on invalid input instead of if checks
- guard methods for library input validation
- check file exists and value is digit in php
- lightweight alternative to symfony validator

## When to choose
- you need fast, low-level, dependency-free input assertions in PHP
- you want exception-based validation without instantiating validator objects
- you are writing business-model or library code needing pre/post-condition checks

## When to avoid
- you need filtering or sanitization, not just validation
- you need localized validation messages or complex validation rules
- you are not working in PHP

## Facets
- artifact type: library
- maturity: stable
- function: testing, error-handling
- domain: developer-tools, web-development, backend
- platform: php
- tags: assertions, input-validation, guard-clauses, preconditions, php-library

## Member repositories
- beberlei/assert (main) score 78

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:51.162140+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:31:16.507774+00:00, confidence not recorded.
  - readme: https://github.com/beberlei/assert (fetched 2026-08-28T04:06:51.162140+00:00, sha 0bd44a16072d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
