talira

Collision

Readable error reports for PHP command-line apps

open sourceMITfree

Collision is a PHP package by Nuno Maduro that shows errors in command-line applications as readable reports: the exception, the lines of code around it and a trimmed stack trace, instead of raw PHP output. It ships with Laravel, so Artisan commands and tests use it, and works with Symfony, PHPUnit, Pest and other frameworks. It's built on the Whoops error handler and installed as a Composer dev dependency.

Problems it solves

  • make PHP command-line errors readable
  • see where an exception happened in my Laravel Artisan command
  • get nicer test failure output in PHPUnit or Pest

Features

  • readable error reports for PHP console apps
  • shows the code around the error and a trimmed stack trace
  • included in Laravel
  • works with Symfony, PHPUnit and Pest
  • built on the Whoops error handler

Alternatives

The same job

These do what Collision does.

  1. Safe PHP PHP core functions that throw exceptions instead of returning false

Compare Collision with the top 3