duncan3dc / exceptions
A small library to catch exceptions and throw them all at the end
Requires
- php: ^7.3 || ^8.0
Requires (Dev)
- duncan3dc/object-intruder: ^0.3 || ^1.0
- maglnet/composer-require-checker: ^2.0 || ^3.0
- mockery/mockery: ^1.6.7
- phpstan/phpstan: ^0.12.100
- phpstan/phpstan-mockery: ^0.12.14
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5.8
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/
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
duncan3dc/exceptions for enterprise
Available as part of the Tidelift Subscription
The maintainers of duncan3dc/exceptions and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.