webmozarts/assert
Assertions to validate method input/output with nice error messages. observed · 2026-08-28
Health v2 · maintenance only
90/100
- Activity 87
- Release rhythm 89
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 8
- age_days: 4193
- days_rel: 79
- days_push: 79
- n_releases_24m: 12
Adoption not part of the score
7651 stars · 164 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A PHP library providing efficient assertions for validating method input and output, throwing InvalidArgumentException with clear, consistently formatted error messages on failure. It is a popular Composer package inspired by beberlei/assert with improved error message usability.
Use cases
- validate method arguments in php
- assert value is a string or integer
- throw exceptions with nice error messages
- defensive programming input checks
- validate constructor parameters
- replace manual type checks with assertions
When to choose
- you need lightweight input validation in PHP with readable error messages
- you want consistent sprintf placeholder ordering in assertion messages
- you prefer a small dependency over a full validation framework
When to avoid
- you need complex rule-based or schema validation
- you want assertions that fail softly instead of throwing exceptions
- you are not working in PHP
Facets
library · maturity stable
error-handling developer-tools developer-tools programming-languages php input-validation assertions defensive-programming composer-package
1 source
- readme: https://github.com/webmozarts/assert · fetched 2026-08-28 · 605718999eb7
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| webmozarts/assert | main | 90 |
For agents
markdown · JSON · MCP: product_card(name="webmozarts/assert")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem