duncan3dc/exceptions

A small library to catch exceptions and throw them all at the end

1.0.0 2017-05-29 18:01 UTC

README

A small PHP library to catch exceptions and throw them all together later.

Full documentation is available at http://duncan3dc.github.io/exceptions/
PHPDoc API documentation is also available at http://duncan3dc.github.io/exceptions/api/

release build coverage

Installation

The recommended method of installing this library is via Composer.

Run the following command from your project root:

$ composer require duncan3dc/exceptions

Usage

use duncan3dc\Exceptions\Catcher;

require __DIR__ . "/vendor/autoload.php";

$catcher = new Catcher;

$catcher->try(function () {
    throw new \Exception("Whoops1!");
});

$catcher->try(function () {
    throw new \Exception("Whoops2!");
});

$catcher->try(function () {
    echo "ok\n";
});

$catcher->throw();

Read more at http://duncan3dc.github.io/exceptions/

Changelog

A Changelog has been available since the beginning of time

Where to get help

Found a bug? Got a question? Just not sure how something works?
Please create an issue and I'll do my best to help out.
Alternatively you can catch me on Twitter