@@ -25,7 +25,7 @@ PHP library for handling exceptions.
25
25
- [ TODO] ( #todo )
26
26
- [ Changelog] ( #changelog )
27
27
- [ Contribution] ( #contribution )
28
- - [ Sponsor] ( #Sponsor )
28
+ - [ Sponsor] ( #sponsor )
29
29
- [ License] ( #license )
30
30
31
31
---
@@ -61,9 +61,7 @@ git clone https://github.com/josantonius/php-exception-handler.git
61
61
62
62
### ExceptionHandler Class
63
63
64
- ``` php
65
- use Josantonius\ExceptionHandler\ExceptionHandler;
66
- ```
64
+ ` Josantonius\ExceptionHandler\ExceptionHandler `
67
65
68
66
Sets a exception handler:
69
67
@@ -72,28 +70,25 @@ Sets a exception handler:
72
70
* Sets a exception handler.
73
71
*
74
72
* @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.
77
75
*
78
76
* @throws NotCallableException if the callback is not callable.
79
77
* @throws WrongMethodNameException if the method names are not string or are empty.
80
78
*
81
79
* @see https://www.php.net/manual/en/functions.first_class_callable_syntax.php
82
80
*/
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 = []
87
85
);
88
86
```
89
87
90
88
## Exceptions Used
91
89
92
90
``` php
93
91
use Josantonius\ExceptionHandler\Exceptions\NotCallableException;
94
- ```
95
-
96
- ``` php
97
92
use Josantonius\ExceptionHandler\Exceptions\WrongMethodNameException;
98
93
```
99
94
0 commit comments