Collision is a PHP library that provides beautiful error reporting for CLI applications, particularly integrated with Laravel, PHPUnit, and Pest. It wraps the Whoops error handler to render exceptions with syntax-highlighted code snippets, stack traces, and solution suggestions. Additionally, it includes a custom PHPUnit/Pest test printer that outputs test results with color-coded summaries, warnings, and slow-test profiling. The library is built on top of Symfony Console, Termwind, and Whoops, and is designed as a drop-in replacement for default error handling in Laravel's artisan commands and PHPUnit test runners. The codebase is well-structured with clear separation of concerns: core error rendering (Provider, Handler, Writer), terminal styling (ConsoleColor, Highlighter), argument formatting (ArgumentFormatter), code coverage reporting (Coverage), and framework-specific adapters (Laravel service provider, PHPUnit event subscribers). The PHPUnit adapter demonstrates advanced event-driven architecture by hooking into PHPUnit's event system to produce a rich, compact test output.
This repository is a modern PHP package skeleton created by Nuno Maduro. It provides a minimal, opinionated starting point for building PHP libraries, featuring a pre-configured toolchain including Laravel Pint for code style, Pest for testing, PHPStan for static analysis, and Rector for automated refactoring. The actual source contains only a placeholder Example class to verify the setup, while the value lies in the well-organized directory structure, Composer scripts, GitHub Actions workflows (testing across OS and dependency versions), and configuration files that enforce high code quality standards. It is designed to be cloned via `composer create-project` and immediately used for new package development. The repo is actively maintained with no open issues, modern dependency versions, and comprehensive CI coverage.