Skip to content
CAI
Software that uses CAICheck a score

nunomaduro/collision

66.9

Adequate · 19 September 2026

3.7k

lines of production code

PHP

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Collision is a PHP library that provides enhanced exception handling and test output formatting for Laravel and PHPUnit applications. It integrates with Laravel to render styled console exceptions and offers a custom Artisan test command supporting parallel execution, code coverage, and database management. The system also includes a PHPUnit 10 adapter that replaces default test printers with a customizable, event-driven output system.

How it got here

2017–2018 — Collision v8 Laravel adapter and testing

7 changes.

This period focused on releasing Collision v8 with PHP 8.2 and Laravel 11 support, introducing a dedicated Laravel adapter for console exception handling. The work included standardizing the development environment with configuration files and adding comprehensive unit tests for core components and adapters to ensure stability.

2020 — Laravel adapter and PHPUnit 10 support

15 changes.

This period focused on extending the library's compatibility with Laravel and PHPUnit 10, introducing new Artisan command options for parallel testing and coverage. It also established a comprehensive test harness using a scaffolded Laravel application to validate these new features and refine exception handling and output formatting.

2022–2026 — PHPUnit 10 and PHP 8.5 compatibility

6 changes.

This period focused on adapting the testing infrastructure to support PHPUnit 10's event-driven architecture, including new printer implementations and event subscribers. It also addressed PHP 8.5+ compatibility by updating Laravel database configuration constants and adding necessary test coverage and structural placeholders.

Features

Adds Laravel adapter for exception handling

Introduces a new Laravel adapter that integrates the Collision library into Laravel applications. This includes a service provider that registers a custom exception handler to render exceptions in the console (excluding unit tests) and binds the necessary provider services. The adapter also includes an Ignition solutions repository to support error solutions provided by Spatie Ignition, and a custom inspector to handle stack traces.

src/Adapters/Laravel · high confidence

Adds PHPUnit 10 adapter support

The library now includes a new adapter for PHPUnit 10, allowing it to function as a test printer for this major version. The \Autoload.php\ file ensures the printer is only registered when PHPUnit 10 is detected, while new classes like \State\, \Style\, and \TestResult\ handle the internal state, output styling, and test result mapping specific to PHPUnit 10's event system.

src/Adapters/Phpunit · high confidence

New Artisan test command with parallel, coverage, and database management options

The \src/Adapters/Laravel/Commands/TestCommand.php\ file introduces a new \php artisan test\ command that delegates to PHPUnit or Pest. It adds support for parallel testing via the \--parallel\ flag, code coverage reporting with \--coverage\ and \--min\ thresholds, and database management options including \--recreate-databases\, \--drop-databases\, and \--without-databases\. The command also respects \--compact\ for output formatting and \--profile\ for slowest tests, while handling environment variables and ANSI color settings.

src/Adapters/Laravel/Commands · high confidence

New contracts for editor rendering and solution retrieval

The library introduces four new interfaces in the Contracts namespace to define how error frames are rendered in the editor and how solutions are retrieved. \RenderableOnCollisionEditor\ allows objects to provide a specific stack frame for the Collision Editor, while \RenderlessEditor\ and \RenderlessTrace\ serve as markers for components that should not render their own UI. Additionally, \SolutionsRepository\ defines the contract for fetching solution arrays from a given throwable, enabling a standardized way to access fix suggestions.

src/Contracts · high confidence

Standardizes development environment and project configuration

This release introduces standard configuration files to improve consistency for contributors and CI environments. An \.editorconfig\ file enforces coding styles (UTF-8, LF line endings, 4-space indentation) across editors, while \.gitattributes\ and \.gitignore\ are added to manage file exports and exclude build artifacts like \vendor/\ and cache files. A \phpunit.xml.dist\ configuration is provided for running tests with PHPUnit 10, and \phpstan.neon.dist\ along with a \phpstan-baseline.neon\ file are added to enable static analysis at the maximum level while ignoring known type issues. Additionally, the \LICENSE\ file has been renamed to \LICENSE.md\ and updated with the author's contact email.

(repo-wide) · high confidence

Behavioural changes

Adds PHPUnit 10 event subscriber for printer registration

The adapter now includes a new \EnsurePrinterIsRegisteredSubscriber\ that hooks into PHPUnit 10's event system to register the Collision printer. This subscriber checks for the \COLLISION\_PRINTER\ environment variable and configures the printer with optional compact and profiling modes, while subscribing to various PHPUnit events (such as test execution, deprecations, and warnings) to ensure output is handled correctly within the PHPUnit 10 lifecycle.

src/Adapters/Phpunit/Subscribers · high confidence

Adds contract for printable test case names

Introduces the \HasPrintableTestCaseName\ interface in the Phpunit adapter contracts, defining methods to retrieve printable test case names and method names. This contract enables consistent formatting of test output identifiers, supporting features like overriding test case names and fixing issues with the \--filter\ option and name printing.

src/Contracts/Adapters · high confidence

Adds internal exception classes for Laravel adapter

The Laravel adapter now includes two new internal exception classes, NotSupportedYetException and RequirementsException, both extending RuntimeException and implementing RenderlessEditor and RenderlessTrace interfaces to control how these specific errors are rendered in the output.

src/Adapters/Laravel/Exceptions · high confidence

Introduces new PHPUnit 10-compatible test output printers

The test runner's console output has been updated to support PHPUnit 10's event-driven architecture. A new \DefaultPrinter\ implementation now listens to specific PHPUnit events (such as test failures, deprecations, and warnings) to render results, replacing the previous facade-based approach. Additionally, a \ReportablePrinter\ wrapper has been added to catch and report internal printer errors, ensuring that issues during output generation do not crash the test run silently.

src/Adapters/Phpunit/Printers · high confidence

Redesigned exception output with new formatting and styling components

The exception display system has been redesigned to improve readability and visual consistency. A new ArgumentFormatter now truncates long string arguments to 1000 characters to prevent clutter. The Writer has been refactored to use a dedicated Highlighter for syntax-colored code snippets and a ConsoleColor class for consistent theming, replacing the previous console color dependency. Additionally, the Coverage reporter now supports hiding files with 100% coverage via a new option, and the Writer respects verbose mode to ensure full stack traces are always displayed regardless of ignore filters.

src · high confidence

Refactored exception handling and test output formatting

The exception handling layer has been restructured with new internal exception classes (InvalidStyleException, ShouldNotHappen, TestOutcome) and a dedicated TestException wrapper. This change modifies how test failure messages are processed: diffs are now colorized, and long 'to contain' / 'not to contain' assertion messages are shortened (truncated to 3 lines with a count of remaining lines) when not in verbose mode, resulting in cleaner, more concise test output for users.

src/Exceptions · high confidence

Fixes

Fix PDO constant compatibility for PHP 8.5+ in Laravel database config

A new script has been added to automatically update the Laravel database configuration file when running on PHP 8.5 or later. The script detects the PHP version and, if applicable, replaces the deprecated \PDO::MYSQL\_ATTR\_SSL\_CA\ constant with the modern \Pdo\\Mysql::ATTR\_SSL\_CA\ constant, ensuring the application remains compatible with newer PHP versions while maintaining backward compatibility for older versions.

scripts · high confidence

Test coverage

Added Laravel application bootstrap configuration for tests; Added Laravel test infrastructure files; Added feature tests for environment configuration and test runner behavior; Added public entry files for the Laravel test application; Added test autoload stub for LaravelApp vendor directory; Added test configuration files for Laravel database and Redis connections; Added test coverage for printer datasets; Added test database scaffolding for LaravelApp; Added test fixtures for exception handling scenarios; Added test harness for Laravel Artisan test command enhancements; Added tests for stdout output handling; Added unit test suite for PHP error and deprecation handling; Added unit tests for Laravel, PHPUnit, and Artisan test command adapters; Added unit tests for core Collision components.

Dependencies

Initial release of Collision v8 with PHP 8.2+ and Laravel 11+ support

This entry introduces the initial composer.json for Collision v8, establishing a minimum PHP version of 8.2.0 and requiring Symfony Console 7.4/8.1. It adds explicit conflicts with Laravel versions outside the 11.48.0–13.x range and PHPUnit versions outside 11.5.50–13.x. The package now includes a Laravel service provider for automatic discovery and sets up development dependencies including Laravel 11/12/13, Pest 3/4/5, and Larastan 3, alongside test scaffolding for a Laravel application.

(dependencies) · high confidence

Housekeeping

Added .gitkeep placeholder in .temp directory

A .gitkeep file was added to the .temp directory to ensure the directory is tracked by version control. This is a structural change with no impact on application behavior or user-facing features.

.temp · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 67.

Lenses

  • Code Health 96
  • Architecture 66
  • Maturity 59
  • Readiness 70
  • Security 95

Changes since last survey

  • 300 commits — 231 feature/other, 69 fixes

By area

  • (root) — 113 commits
  • src/Adapters — 78 commits
  • (repo) — 30 commits
  • .github/workflows — 30 commits
  • tests/Unit — 21 commits
  • tests/LaravelApp — 15 commits
  • src/Coverage.php — 6 commits
  • src/Exceptions — 2 commits
  • src/Writer.php — 2 commits
  • tests/FakeProgram — 2 commits
  • tests/Printer — 1 commit

Notable commits

  • fix: Add dontReportDuplicates and fixes return types
  • fix: Fix version constraint in workflow matrix
  • fix: Fixes --compact
  • fix: Fixes types
  • fix: Fixes wrong ignore
  • fix: Merge pull request #257 from fabio-ivona/fix-pest-interceptor-snippets
  • fix: Merge pull request #275 from KarinaRashchynskaya/php-unit-argument-fix
  • fix: Merge pull request #288 from Jubeki/fix/dontReportDuplicates
  • fix: Merge pull request #350 from nunomaduro/fix/test-case-boundary-on-pre-prep-events
  • fix: Revert "fix: Pest parallel test names"
  • fix: Revert "wip"
  • fix: chore: fix test badge in readme
  • fix: chore: fixes coding style
  • fix: chore: fixes dependencies
  • fix: chore: fixes static analysis
  • fix: chore: fixes style
  • fix: chore: fixes style
  • fix: chore: fixes style
  • fix: chore: fixes style
  • fix: chore: fixes test suite
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

nunomaduro/collision 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 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 9716022d2d48a14fa72bcc40239259051b27a1aa — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.