webmozarts/assert
68.6
Adequate · 13 November 2026
7.7k
lines of production code
PHP
primary language
7
measurements over time
What this system is
This system is a PHP assertion library designed for PHP 8.2+ that provides a comprehensive suite of type-checking and value-validation methods. It supports fluent programming by returning validated values and offers specialized variants for handling nulls and collections. The library is heavily integrated with static analysis tools like Psalm to ensure type safety and includes automated tooling for maintaining code consistency and documentation.
Features
Added maintainers-only code generation tools for type definitions and static analysis tests
New scripts in the bin directory allow maintainers to automatically regenerate the Mixin trait (which provides nullOr\, all\, and allNullOr\* variants of assertion methods) and the HasAssert marker class based on the Assert class's reflection data. Additionally, a generator creates static analysis test files that verify assertions do not return values, ensuring correct behavior for static analysis tools like Psalm.
bin · high confidence
Initial project infrastructure and configuration files
This change introduces the foundational configuration files for the project, including \.editorconfig\ for consistent code formatting, \.gitattributes\ to exclude development tools and tests from distribution archives, \.gitignore\ for local artifacts, and \.php-cs-fixer.php\ defining the coding standards. It also adds \psalm.xml\ for static analysis configuration, \phpunit.xml.dist\ for the test suite, along with the \LICENSE\, \README.md\, and \CHANGELOG.md\ files to document the library and its history.
(repo-wide) · high confidence
Behavioural changes
Major refactor: strict typing, return values, and new assertion variants
The assertion library has been rewritten to PHP 8+ standards, enforcing strict types and adding return types to all methods so that assertions now return the validated value (enabling fluent usage). The \Mixin\ trait now provides \nullOr\\, \all\\, and \allNullOr\*\ variants for every assertion, allowing users to handle nulls or iterate over collections without manual checks. New assertions have been added for UUIDs, IPv4/IPv6, Unicode letters, non-empty lists/maps, and various type checks (e.g., \isList\, \isMap\, \isStatic\). The library also introduces a custom \InvalidArgumentException\ and a Psalm plugin (\PsalmPlugin\) with a \HasAssert\ registry to improve static analysis precision. Deprecated methods like \isTraversable\ have been removed in favor of \isIterable\.
src · high confidence
Test coverage
Added project code and static analysis consistency tests; Expanded static-analysis test coverage for Assert methods.
Dependencies
Initial project setup with PHP 8.2 requirement and tooling dependencies
The project now requires PHP 8.2 and the \ext-ctype\, \ext-date\, and \ext-filter\ extensions, replacing previous polyfills with native extensions. The \composer.json\ also introduces a suite of development tools locked in separate \tools/\ directories: \friendsofphp/php-cs-fixer\ (v3.64), \phpunit/phpunit\ (v11.0), \vimeo/psalm\ (v6.0), and \roave/backward-compatibility-check\ (v8.10).
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 66 → 69 (+2.2)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 96 → 95 (-1.5)
- Architecture 100 → 100 (+0.0)
- Maturity 50 → 55 (+5.2)
- Readiness 64 → 64 (-0.6)
- Security 98 → 100 (+2.0)
New (8)
- Edited copies of one member (5 members, 13+ corresponding lines) (src/Assert.php)
- Edited copies of one member (6 members, 16+ corresponding lines) (src/Assert.php)
- Edited copies of one member (8 members, 13+ corresponding lines) (src/Assert.php)
- Edited copy of a member (11 corresponding lines) (src/Assert.php)
- Edited copy of a member (12 corresponding lines) (src/Assert.php)
- Edited copy of a member (16 corresponding lines) (src/Assert.php)
- Edited copy of a member (17 corresponding lines) (src/Assert.php)
- Medium CVE: [GHSA redacted] (tools/roave-bc-check/composer.lock)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
webmozarts/assert was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 8a163706bbcac613733dba03f51e13b5eb1bb819 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-859b6d22580d.