Update phpDoc for error and exception handlers

This commit is contained in:
Sebastian Meyer 2024-02-11 19:16:13 +01:00
parent 3610dccfc5
commit e26a6d4b9d
2 changed files with 8 additions and 6 deletions

View File

@ -28,12 +28,13 @@ use ErrorException;
/** /**
* Throw internal errors as exceptions. * Throw internal errors as exceptions.
* *
* Usage: set_error_handler(new ThrowErrorException()); * If registered as error handler, this converts an internal PHP error into an
* `ErrorException`. It respects the `error_reporting` directive.
*
* > Usage: `set_error_handler(new ThrowErrorException());`
* *
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com> * @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
* @package Basics\ErrorHandlers * @package Basics\ErrorHandlers
*
* @api
*/ */
class ThrowErrorException class ThrowErrorException
{ {

View File

@ -28,12 +28,13 @@ use Throwable;
/** /**
* Trigger errors for uncaught exceptions. * Trigger errors for uncaught exceptions.
* *
* Usage: set_exception_handler(new TriggerExceptionError()); * If registered as exception handler, this catches an uncaught exception and
* convert it into an internal PHP error of severity `E_USER_ERROR`.
*
* > Usage: `set_exception_handler(new TriggerExceptionError());`
* *
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com> * @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
* @package Basics\ErrorHandlers * @package Basics\ErrorHandlers
*
* @api
*/ */
class TriggerExceptionError class TriggerExceptionError
{ {