Collision Is An Error Handler Framework for Console Applications
Published on by Paul Redmond
Collision is a new package by Nuno Maduro that provides error handling for command line applications. It’s built on top of the Whoops package and provides adapters for both the Laravel artisan console and PHPUnit.
Once installed, this package will automatically work with Laravel through Laravel 5.5 package auto-discovery. Here’s an example of what Collision might look like with artisan:
Collision supports PHPUnit by adding the following to your project’s phpunit.xml
configuration:
<listeners> <listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener" /></listeners>
You can also use Collision as a stand-alone error handler for CLI tools. You just need to register the error handler in your code manually:
(new \NunoMaduro\Collision\Provider)->register();
Check out the official repo for more information on Collision and learn how to start using it with Laravel artisan, PHPUnit, and PHP CLI projects.