sebastianbergmann/diff
69.2
Adequate · 13 November 2026
1.6k
lines of production code
PHP
primary language
7
measurements over time
What this system is
Features
New script to extract release notes from changelog
A new PHP script, extract-release-notes.php, has been added to the build/scripts directory. This tool allows users to programmatically extract the release notes for a specific version tag from the project's ChangeLog.md file, facilitating automated release processes.
build/scripts · high confidence
New strict unified diff output builder and interface
The library now includes a new \DiffOutputBuilderInterface\ and a \StrictUnifiedDiffOutputBuilder\ implementation that generates strict Unified diff output with configurable hunks, context lines, and file headers. A new \DiffOnlyOutputBuilder\ is also added for producing loose unified diff output that lists only changed lines without line numbers. These changes allow users to choose between strict standard-compliant diffs and simplified diff formats.
src/Output · 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
143 commits (1 fix) modifying tools
A change to existing behaviour in tools — 143 commits (1 fix), 3 files: “Update tools”; “Go back to Composer 1.10.2”; “Update tools (and manage Composer through Phive)”; and 6 more.
tools · medium confidence · unverified
Introduction of a custom Exception interface and new exception classes
The library now defines a custom \Exception\ interface that extends \Throwable\, allowing for more specific exception handling. Two new exception classes have been added: \ConfigurationException\, which extends \InvalidArgumentException\ to provide detailed error messages for invalid options, and \NoMiddleSnakeFoundException\, which extends \LogicException\ to signal invariant violations during diff calculations.
src/Exception · high confidence
Major refactoring of diff engine with new data structures and Myers algorithm
The core diffing logic has been rewritten to use Eugene W. Myers' linear-space algorithm, significantly improving performance for large inputs. The public API now relies on new value objects: \Chunk\ represents a range of lines, \Line\ represents an individual line with added/removed/unchanged status, and \Diff\ holds the file metadata and chunks. The \Differ\ class now accepts a \DiffOutputBuilderInterface\ to allow flexible output formatting, and a new \Parser\ class has been added to parse unified diff strings back into \Diff\ objects. The old \Diff\ class structure and the custom \autoload.php\ have been removed in favor of modern PHP standards (strict types, final classes, and standard autoloading).
src · high confidence
Modernized build automation and development tooling
The project has overhauled its build and development environment to use modern standards. Composer is now managed via Phive in the \tools/\ directory, and static analysis has switched from Psalm to PHPStan (configured at level 10 with strict rules). The PHPUnit configuration has been updated to the current schema, and the legacy PEAR installation method has been removed from the documentation. Additionally, Renovate is configured for automated dependency updates, and the license has been standardized to the BSD 3-Clause format.
(repo-wide) · high confidence
Test coverage
Added integration tests for StrictUnifiedDiffOutputBuilder; Added test fixtures for unified diff assertion and multi-chunk parsing; Added test utilities for validating unified diff formats; Added tests for ConfigurationException; Added tests for DiffOnly and StrictUnifiedDiff output builders; Added unit tests for Diff components.
Dependencies
PHP 8.4 requirement and PHPStan 2 tooling isolation
The project now requires PHP 8.4 or higher, dropping support for all previous versions, and updates its development dependencies to PHPUnit ^13.3.5 and Symfony Process ^7.4.19. Additionally, a new isolated PHPStan 2 tooling environment has been introduced under \tools/.phpstan/\, bundling PHPStan ^2.2.16 with strict rules and extension installer, while the main \composer.json\ has been updated to reflect the new PHP version constraint, updated homepage URL, and a branch alias for version 9.0.
(dependencies) · high confidence
PHPStan static analysis tooling updated to version 2.2.16
The PHPStan static analysis tool and its associated extensions in the \tools/.phpstan\ directory have been updated. The core \phpstan/phpstan\ package is now at version 2.2.16, and \phpstan/phpstan-strict-rules\ is at 2.0.12. Additionally, \ergebnis/phpstan-rules\ has been updated to version 2.14.0, which includes new rules such as \NoPhpstanIgnoreRule\ and support for PHP 8.6, while \phpstan/extension-installer\ remains at 1.4.3 to manage these extensions. Also in this area: 1 commit (0 fixes) modifying tools, tools/.phpstan/vendor/phpstan/phpstan-phpunit; 3 commits (0 fixes) modifying tools; Updated phpstan to version 2.2.13.
tools/.phpstan · medium confidence · unverified
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 → 69 (-1.2)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 93 → 92 (-1.7)
- Architecture 100 → 100 (-0.1)
- Maturity 54 → 54 (+0.0)
- Readiness 79 → 78 (-0.5)
- Security 88 → 81 (-6.3)
Resolved (1)
- Documentation: no architecture or design documentation
Changes since last survey
- 27 commits — 25 feature/other, 2 fixes
By area
- tools/.phpstan — 13 commits
- (root) — 7 commits
- (repo) — 3 commits
- tests/Output — 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: Manage PHP-CS-Fixer with Composer instead of Phive
- change: Merge branch '7.0'
- change: Merge branch '7.0'
- change: Merge branch '7.0'
- change: Remove stale entry
- change: Update PHPStan packages
- change: Update PHPStan packages
- change: Update dependency ergebnis/phpstan-rules to ^2.17.0
- change: Update dependency ergebnis/phpstan-rules to ^2.17.1
- change: Update dependency phpstan/phpstan to ^2.3.3
- change: Update dependency phpstan/phpstan to ^2.3.3
- change: Update dependency phpstan/phpstan to ^2.3.5
- change: Update dependency phpstan/phpstan to ^2.3.5
- change: Update dependency phpstan/phpstan-phpunit to ^2.1.2
- change: Update dependency phpstan/phpstan-strict-rules to ^2.1.1
- change: Update dependency phpstan/phpstan-strict-rules to ^2.1.1
- change: Update dependency phpunit/phpunit to ^12.5.42
- change: Update dependency phpunit/phpunit to ^12.5.43
- …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
sebastianbergmann/diff 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 073b76dbc93fb5c3f7603fa7773e6ef74a83109f — 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.