Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | interface ErrorHandlerInterface |
||
10 | { |
||
11 | /** |
||
12 | * Set the caught error. |
||
13 | * |
||
14 | * @param \Throwable|\Exception|\Error |
||
15 | */ |
||
16 | public function setError($error); |
||
17 | |||
18 | /** |
||
19 | * Get the caught error. |
||
20 | * |
||
21 | * @return \Throwable|\Exception|\Error |
||
22 | */ |
||
23 | public function getError(); |
||
24 | |||
25 | /** |
||
26 | * Log an error or exception |
||
27 | * |
||
28 | * @param \Exception|\Error $error |
||
29 | */ |
||
30 | public function log($error); |
||
31 | } |
||
32 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.