Respect/Validation
58.8
Adequate · 17 November 2026
17.2k
lines of production code
PHP
primary language
5
measurements over time
What this system is
This system is a PHP validation library that provides a fluent API for validating data types, formats, and structures. It supports domain-specific checks such as postal codes, email domains, and phone numbers, while offering advanced features like short-circuit evaluation, nested result querying, and customizable error message formatting. The library is designed for modern PHP environments, utilizing dependency injection and static analysis to ensure robust type safety and performance.
How it got here
2010–2024 — Modernization and test expansion
12 changes.
The project underwent a significant infrastructure overhaul, migrating to PHP 8.5+, Pest, and PHPUnit 10/12 while reorganizing the repository structure. This period focused on establishing a robust baseline for version 0.5.0 with stricter coding standards and static analysis. Concurrently, extensive test coverage was added for validation helpers, message formatting, and regression scenarios to ensure reliability.
2025–2026 — Validation engine refactoring and test expansion
21 changes.
The project underwent a significant refactoring of the validation core, introducing a new dependency container, fluent API mixins, and short-circuit evaluation to improve performance and code organization. This structural overhaul was accompanied by the addition of comprehensive data files for domain and postal code validation, alongside a new PHP-based CLI console for maintenance tasks. A massive expansion of the test suite followed, covering unit, feature, and benchmark tests to ensure the stability and correctness of the new architecture.
Features
Added postal code validation regexes for countries
The data directory now includes a PHP file containing regex patterns for validating postal codes across numerous countries. This addition provides the underlying data required for postal code format validation, supporting features that verify address inputs against country-specific standards.
data · high confidence
Introduce new validation transformer infrastructure
Added the core components for a new validation transformation system: the \Transformer\ interface, the \ValidatorSpec\ data structure for representing validator states, and the \Prefix\ transformer which automatically decomposes validators with specific prefixes into nested structures based on generated constants.
src/Transformers · high confidence
Introduction of mixin interfaces for validation builders and chains
The \src/Mixins\ directory now contains a comprehensive set of PHP interfaces (such as \Builder\, \Chain\, \AllBuilder\, \KeyBuilder\, \LengthBuilder\, \MaxBuilder\, \MinBuilder\, and \NotBuilder\) that define the method signatures for the validation library's fluent API. These interfaces expose the full range of validation capabilities—including type checks, format validations, and logical operators—structured into builder and chain patterns, providing the contract for the library's validation methods.
src/Mixins · high confidence
New developer tooling commands for documentation, SPDX, and mixin linting
The \src-dev\ package introduces several new Symfony Console commands to automate and enforce quality standards in the codebase. The \lint:docs\ command applies linters to Markdown documentation files, including checks for validator headers, changelog formatting, and assertion message consistency. The \lint:spdx\ command ensures REUSE compliance by normalizing SPDX headers and tracking contributors across source and documentation files. Additionally, \lint:mixin\ regenerates and validates mixin interfaces and prefix constants based on validator attributes, while \smoke-tests:check-complete\ verifies that all validators are covered by the smoke test provider. These tools help maintain consistency and reduce manual overhead in documentation and code generation.
src-dev · high confidence
Behavioural changes
Added TLD data file for domain validation
A new PHP file (\data/domain/tld.php\) has been added to the codebase, containing a comprehensive list of Top-Level Domains (TLDs) sourced from IANA. This data file supports the domain validation logic, specifically enabling the \UpdateDomainSuffixesCommand\ and the public suffix validator to operate with an up-to-date registry of valid TLDs.
data/domain · high confidence
Introduce PHP-based CLI console for validation and maintenance tasks
The repository now uses a new PHP-based \bin/console\ script to replace previous shell-based tooling. This console provides a unified interface for running various linting commands (including documentation, SPDX, and mixin validation) and data update utilities (such as domain suffix and postal code updates), making these maintenance operations more robust and integrated with the project's PHP ecosystem.
bin · high confidence
Repository structure and tooling overhaul
The project has been reorganized to improve developer experience and code quality. The source code directory was renamed from \library/\ to \src/\, and the main entry point class was renamed from \Validator\ to \ValidatorBuilder\, with a global \v\ class alias provided in \aliases.php\ for backward compatibility. The testing framework was upgraded to PHPUnit 10.5, with tests split into \unit\, \feature\, and \inference\ suites, and static analysis (PHPStan) raised to level 8. Documentation is now generated via MkDocs and hosted on Read the Docs, supported by a new \.readthedocs.yaml\ configuration. Additionally, the repository now enforces stricter coding standards via PHPCS and includes REUSE compliance metadata.
(repo-wide) · high confidence
Updated public suffix list data
The public suffix data files in data/domain/public-suffix have been refreshed with new rules and wildcards for numerous country-code and generic top-level domains (including .AC, .AE, .AI, .APP, .AWS, .BR, .CA, .CN, .COM, and many others). This update ensures that domain validation and parsing correctly recognize the latest official public suffixes and their associated service provider subdomains.
data/domain/public-suffix · high confidence
Validation engine refactored to use Respect/Fluent and a new dependency container
The validation core has been rewritten to integrate Respect/Fluent and Respect/Parameter, replacing the legacy NamespacedValidatorFactory with a new FluentValidatorFactory and AutowiringLookup. This change introduces a ContainerRegistry that manages dependencies (including PhoneNumberUtil and UuidFactory) and allows passing custom definitions to the container. Users benefit from improved rule instantiation via the Fluent API, better error handling through new exception classes (ComponentException, InvalidValidatorException), and enhanced result querying capabilities in ResultQuery, including wildcard support for path-based lookups.
src · high confidence
Validator library refactored with new traits, renamed classes, and short-circuit evaluation
The validation library has been restructured to improve performance and code organization. A new ShortCircuitable interface and CanEvaluateShortCircuit trait have been introduced, allowing validators like All, AllOf, and AnyOf to stop processing early when a failure is detected. Several validators have been renamed to better reflect their behavior: Call is now After, Callback is now Satisfies, and Lazy is now Factory. The library also introduces new helper traits for comparing values, validating dates, and checking iterables, alongside a new DataLoader for efficient data loading. These changes optimize validation speed and clarify the API for users.
src/Validators · high confidence
Fixes
7 commits (4 fixes) fixing src/Message
A fix in src/Message — 7 commits (4 fixs), 13 files.
src/Message · medium confidence · unverified
Test coverage
Added Pest-based regression tests for validation error reporting; Added benchmark tests for validation performance; Added static type inference tests for validator mixins; Added test fixtures for data providers and file system scenarios; Added test helper trait for validation message structures; Added test helpers for message formatting and rendering; Added test infrastructure and stub validators for the validation library; Added test stubs for recursive attribute validation and nested structures; Added unit tests for InterpolationRenderer and TemplateRegistry; Added unit tests for core validation validators; Added unit tests for exception message formatting; Added unit tests for message formatters and result filters; Added unit tests for the Prefix transformer; Added unit tests for the Validators namespace; Added unit tests for validation core components; Added unit tests for validation helpers and data loading; Added validation message tests for Transformers; Expanded test coverage for validation logic and error reporting; Expanded test coverage for validation message formatting and result querying; Migrate test suite to Pest and add custom assertion helpers; New test infrastructure and expanded validator coverage.
Dependencies
Initial release of Respect/Validation v0.5.0 with PHP 8.5+ support
This entry establishes the baseline for version 0.5.0 of the Respect/Validation library, introducing a new \composer.json\ and \composer.lock\ that define the project's dependency structure. The library now requires PHP 8.5 or higher and relies on PSR-11 (\psr/container\) for dependency injection, alongside internal dependencies like \respect/config\, \respect/fluent\, and \respect/parameter\. Development tooling is standardized on PHPUnit 12.5, PHPStan 2.0, and Pest 4.6, while documentation builds depend on MkDocs 1.5.0 and related Python packages defined in \docs/requirements.txt\.
(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 56.6 → 58.8 (+2.2)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 81.6 → 81.1 (-0.5)
- Architecture 87.4 → 81.3 (-6.1)
- Maturity 51.7 → 54.6 (+2.9)
- Readiness 48.0 → 51.7 (+3.7)
- Security 63.5 → 63.5 (0.0)
- Performance 100.0 → 100.0 (0.0)
Resolved (4)
- Duplicated block (26 lines × 2) (src-dev/Spdx/HeaderRebuilder/HtmlHeaderRebuilder.php)
- Inverted test pyramid
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
New (27)
- Circular dependency (src/FluentValidatorFactory.php)
- Edited copies of one member (3 members, 18+ corresponding lines) (src/Validators/CountryCode.php)
- Edited copies of one member (4 members, 6+ corresponding lines) (src/Validators/Date.php)
- Edited copy of a member (10 corresponding lines) (src/Validators/AllOf.php)
- Edited copy of a member (10 corresponding lines) (src/Validators/Contains.php)
- Edited copy of a member (10 corresponding lines) (src/Validators/UndefOr.php)
- Edited copy of a member (11 corresponding lines) (src/Validators/EndsWith.php)
- Edited copy of a member (13 corresponding lines) (src/Validators/Image.php)
- Edited copy of a member (14 corresponding lines) (src/ResultQuery.php)
- Edited copy of a member (18 corresponding lines) (src/Validators/All.php)
- Edited copy of a member (21 corresponding lines) (src/Validators/Pesel.php)
- Edited copy of a member (6 corresponding lines) (src/Validators/KeyOptional.php)
- Edited copy of a member (6 corresponding lines) (src/Validators/Max.php)
- Edited copy of a member (7 corresponding lines) (src/Validators/Key.php)
- Edited copy of a member (8 corresponding lines) (src/Validators/Between.php)
- Edited copy of a member (9 corresponding lines) (src/Validators/Base64.php)
- Off-boarding risk: anonymized user #1
- Orphaned file (src-dev/Commands/LintDocsCommand.php)
- Orphaned file (src/ValidatorBuilder.php)
- Orphaned file (src/Validators/All.php)
- …and 7 more
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Respect/Validation 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 17 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 10f7787d752576bedc80a654d66d17879a5e73d2 — 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.85+preprod-eba6548ac50f.