sebastianbergmann/comparator
70.6
Strong · 17 November 2026
2k
lines of production code
PHP
primary language
5
measurements over time
What this system is
Features
Introduction of custom exception interfaces and classes
The library now defines a custom \Exception\ interface extending \Throwable\ and a \RuntimeException\ class within the \SebastianBergmann\\Comparator\ namespace. This change allows the library to use its own exception hierarchy, which may improve type safety and allow for more specific exception handling by consumers of the library.
src/exceptions · high confidence
Behavioural changes
1 commit (0 fixes) modifying tools/.php-cs-fixer
A change to existing behaviour in tools/.php-cs-fixer — 1 commit, 20 files: “Manage PHP-CS-Fixer with Composer instead of Phive”.
tools/.php-cs-fixer · medium confidence · unverified
144 commits (0 fixes) modifying tools
A change to existing behaviour in tools — 144 commits, 4 files: “Update tools”; “Go back to Composer 1.10.2”; “Use PHPStan instead of Psalm”; and 4 more.
tools · medium confidence · unverified
Automated release note extraction script added
A new PHP script, build/scripts/extract-release-notes.php, has been added to the build tooling. This script automates the extraction of release notes from the ChangeLog.md file based on a provided version tag, supporting the workflow of creating releases when tags are pushed.
build · high confidence
Comparator library rewritten for modern PHP with new type-specific comparators
The \src\ directory has been completely rewritten to target modern PHP versions, introducing strict typing, final classes, and a factory-based architecture for registering comparators. Several new comparators have been added to handle specific types: \ClosureComparator\ for comparing closures by reflection, \EnumerationComparator\ for PHP 8.1+ enums, \NumberComparator\ for \BcMath\\Number\ objects, and \MockObjectComparator\ to filter PHPUnit mock properties. Existing comparators like \DateTimeComparator\ and \DOMNodeComparator\ have been updated to support \DateTimeInterface\, ignore case correctly, and use canonicalization. Legacy classes such as \DOMDocumentComparator\, \DoubleComparator\, and the custom \Exception\ class have been removed. The \ComparisonFailure\ class now extends \RuntimeException\ and supports serialization, while the \Comparator\ base class now relies on a factory for exporter and context line access.
src · high confidence
Modernized build automation and configuration
The project has replaced legacy Travis CI and PHPUnit configurations with modern equivalents: \.travis.yml\ and \phpunit.xml.dist\ are removed in favor of \phpunit.xml\, \phpstan.neon\ (configured at level 10 with strict rules), \build.xml\, and \renovate.json\ for automated dependency updates. A new \.php-cs-fixer.dist.php\ standardizes code formatting, while \.gitattributes\ and \.gitignore\ are updated to exclude build artifacts and tools from exports. The license is updated to BSD 3-Clause, a \SECURITY.md\ policy is added, and the \Factory::getDefaultInstance()\ static method is removed from the README in favor of \new Factory\.
(repo-wide) · high confidence
Test coverage
Added test fixtures for comparator edge cases; Added unit tests for comparator components; Removed ComparatorTest.php.
Dependencies
PHP 8.4 requirement and dependency updates for sebastian/comparator
The sebastian/comparator package now requires PHP 8.4 or higher, dropping support for older PHP versions. Dependencies on sebastian/diff and sebastian/exporter have been updated to ^9.0.1 and ^8.2.1 respectively, and the package now suggests ext-bcmath for BcMath\\Number comparison support. Additionally, the dev dependency on phpunit/phpunit has been updated to ^13.3.6, and the repository homepage URL has been corrected to use HTTPS.
(dependencies) · high confidence
PHPStan static analysis tooling updated to version 2.2.16
The local PHPStan installation in tools/.phpstan has been updated to version 2.2.16, along with its extensions phpstan-strict-rules (2.0.12) and ergebnis/phpstan-rules (2.14.0). This upgrade brings stricter static analysis rules and improved support for newer PHP versions, enhancing the detection of potential code issues during development.
tools/.phpstan · 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 70.7 → 70.6 (-0.1)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 98.5 → 98.2 (-0.3)
- Architecture 100.0 → 100.0 (0.0)
- Maturity 54.4 → 54.4 (0.0)
- Readiness 79.1 → 79.1 (0.0)
- Security 85.0 → 85.0 (0.0)
New (1)
- Edited copy of a member (8 corresponding lines) (src/ScalarComparator.php)
Changes since last survey
- 17 commits — 15 feature/other, 2 fixes
By area
- tools/.phpstan — 6 commits
- (repo) — 4 commits
- (root) — 3 commits
- tests/unit — 2 commits
- tools/.php-cs-fixer — 1 commit
- tools/composer — 1 commit
Notable commits
- fix: Fix errors reported by PHPStan
- fix: Fix errors reported by PHPStan
- change: Leftover from fbd78d3491c5821521b76fbc803cff33589cba3a
- change: Manage PHP-CS-Fixer with Composer instead of Phive
- change: Merge branch '7.1'
- change: Merge branch '7.1'
- change: Merge branch '7.1'
- change: Merge branch '7.1'
- change: Remove stale entry
- change: Update dependency ergebnis/phpstan-rules to ^2.17.1
- change: Update dependency ergebnis/phpstan-rules to ^2.17.1
- change: Update dependency phpstan/phpstan to ^2.3.6
- change: Update dependency phpstan/phpstan-phpunit to ^2.1.2
- change: Update dependency phpunit/phpunit to ^13.4.7
- change: Update tools
- change: Use phpstan/phpstan-deprecation-rules
- change: Use phpstan/phpstan-phpunit
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
sebastianbergmann/comparator 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 51fd717da1a79b5848533f6af8f109dd1c8f64be — 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.84+preprod-d645ca9bbedd.