webmozarts/assert
Some data may be outdated — see provenance labels.
Assertions to validate method input/output with nice error messages. observed · 2026-10-03
Health v2 · maintenance only
92/100
- Activity 97
- Release rhythm 81
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.
- gap_med: 8
- age_days: 4241
- days_rel: 127
- days_push: 18
- n_releases_24m: 12
Adoption not part of the score
7649 stars · 166 forks observed · 2026-10-03
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-10-03 · 605718999eb7
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| webmozarts/assert | main | 92 |
For agents
markdown · JSON · MCP: product_card(name="webmozarts/assert")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem