Exception's flow
composer require undercloud/exceptor
PHP 5.4+
Provides a mechanism for catching errors and exceptions in the application flow. All built-in types of errors are transformed into exceptions, which greatly simplifies debugging. It also intercepts errors due to lack of memory and execution timeout.
// catch all
error_reporting(E_ALL);
use Undercloud\Exception\FlowHandler;
(new FlowHandler(function(){
try {
// your code
// PHP 5.x
} catch (Exception $e) {
return $e;
// PHP 7.x
} catch (Throwable $e) {
return $e;
}
}))->flow(function($e){
// handle exception
})
- All standard PHP's exceptions
- CompileErrorException
- CompileWarningException
- CoreErrorException
- CoreWarningException
- DeprecatedException
- NoticeException
- ParseException
- RecoverableErrorException
- StrictException
- UserDeprecatedException
- UserErrorException
- UserNoticeException
- UserWarningException
- WarningException
- ExecutionTimeoutException
- OutOfMemoryException
MIT