From 6182d8f10991b18f22912dfa2212b9c81e352126 Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Wed, 26 Jun 2024 23:55:57 +0300 Subject: [PATCH] doc: Updated ReadMe Docs --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c49e99..1534209 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,12 @@ namespace webfiori\error; class DefaultExceptionsHandler extends AbstractExceptionHandler { public function __construct() { parent::__construct(); + + //Set handler name. Each registered handler must have a unique name. + $this->setName('Cool Handler'); + + //Sets the priority of the handler. Larger means that it has higher priority. + $this->setPriority(100); } /** * Handles the exception. @@ -89,10 +95,10 @@ class DefaultExceptionsHandler extends AbstractExceptionHandler { ### Setting a Custom Exceptions Handler -After implementing the handler, the developer must set it as exceptions handler. To do that, simply the developer have to use the method `Handler::setHandler()` in any place in his source code. +After implementing the handler, the developer must set it as exceptions handler. To do that, simply the developer have to use the static method `Handler::registerHandler()` in any place in his project. ``` php -Handler::setHandler(new DefaultExceptionsHandler()); +Handler::registerHandler(new DefaultExceptionsHandler()); ```