From e26a6d4b9d796202867f952f20431fb9efcfb126 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sun, 11 Feb 2024 19:16:13 +0100 Subject: [PATCH] Update phpDoc for error and exception handlers --- src/ErrorHandlers/ThrowErrorException.php | 7 ++++--- src/ErrorHandlers/TriggerExceptionError.php | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ErrorHandlers/ThrowErrorException.php b/src/ErrorHandlers/ThrowErrorException.php index ed7c241..bc2dd62 100644 --- a/src/ErrorHandlers/ThrowErrorException.php +++ b/src/ErrorHandlers/ThrowErrorException.php @@ -28,12 +28,13 @@ use ErrorException; /** * 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 * @package Basics\ErrorHandlers - * - * @api */ class ThrowErrorException { diff --git a/src/ErrorHandlers/TriggerExceptionError.php b/src/ErrorHandlers/TriggerExceptionError.php index 83b7f8c..adfd42c 100644 --- a/src/ErrorHandlers/TriggerExceptionError.php +++ b/src/ErrorHandlers/TriggerExceptionError.php @@ -28,12 +28,13 @@ use Throwable; /** * 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 * @package Basics\ErrorHandlers - * - * @api */ class TriggerExceptionError {