@@ -25,7 +25,7 @@ PHP library for handling exceptions.
2525- [ TODO] ( #todo )
2626- [ Changelog] ( #changelog )
2727- [ Contribution] ( #contribution )
28- - [ Sponsor] ( #Sponsor )
28+ - [ Sponsor] ( #sponsor )
2929- [ License] ( #license )
3030
3131---
@@ -61,9 +61,7 @@ git clone https://github.com/josantonius/php-exception-handler.git
6161
6262### ExceptionHandler Class
6363
64- ``` php
65- use Josantonius\ExceptionHandler\ExceptionHandler;
66- ```
64+ ` Josantonius\ExceptionHandler\ExceptionHandler `
6765
6866Sets a exception handler:
6967
@@ -72,28 +70,25 @@ Sets a exception handler:
7270 * Sets a exception handler.
7371 *
7472 * @param callable $callback Exception handler function.
75- * @param array $runBeforeCallback Method names to call in the exception before run callback.
76- * @param array $runAfterCallback Method names to call in the exception after run callback.
73+ * @param string[] $runBeforeCallback Method names to call in the exception before run callback.
74+ * @param string[] $runAfterCallback Method names to call in the exception after run callback.
7775 *
7876 * @throws NotCallableException if the callback is not callable.
7977 * @throws WrongMethodNameException if the method names are not string or are empty.
8078 *
8179 * @see https://www.php.net/manual/en/functions.first_class_callable_syntax.php
8280 */
83- new ExceptionHandler (
84- callable $callback,
85- string[] $runBeforeCallback = [],
86- string[] $runAfterCallback = []
81+ public function __construct (
82+ private callable $callback,
83+ private array $runBeforeCallback = [],
84+ private array $runAfterCallback = []
8785);
8886```
8987
9088## Exceptions Used
9189
9290``` php
9391use Josantonius\ExceptionHandler\Exceptions\NotCallableException;
94- ```
95-
96- ``` php
9792use Josantonius\ExceptionHandler\Exceptions\WrongMethodNameException;
9893```
9994
0 commit comments