From c740938a0d85b7bd37e3fdbc430007b72dc1165b Mon Sep 17 00:00:00 2001 From: Dustin Wilson Date: Fri, 3 Nov 2023 22:59:06 -0500 Subject: [PATCH] Added JSONHandler to the README. --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f8db19..bc998a4 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ abstract class Handler { _CONTENT\_TYPE_: The mime type of the content that is output by the handler -_BUBBLES_: When returned within the output bitmask, it causes the stack loop to continue onto the next handler after handling; this is a default behavior. +_BUBBLES_: When returned within the output bitmask, it causes the stack loop to continue onto the next handler after handling; this is the default behavior. _EXIT_: When returned within the output bitmask, it causes Catcher to exit after running all handlers. _LOG_: When returned within the output bitmask, it causes Catcher to log the output to a supplied logger. _NOW_: When returned within the output bitmask, it causes Catcher to have the handler immediately be invoked. @@ -323,6 +323,23 @@ Returns the previous `ThrowableController` if there is one Returns the throwable controlled by this class instance +### MensBeam\Catcher\JSONHandler ### + +```php +namespace MensBeam\Catcher; + +class JSONHandler extends Handler { + public const CONTENT_TYPE = 'application/json'; + + protected bool $_prettyPrint = true; +} +``` + +#### Options #### + +_prettyPrint_: If true the handler will pretty print JSON output. Defaults to _true_. + + ### MensBeam\Catcher\PlainTextHandler ### ```php