Conditions | 4 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
17 | public static function handle($callback, $handler, $types = null) |
||
18 | 20 | { |
|
19 | \set_error_handler($handler, $types === null ? \E_ALL | \E_STRICT : $types); |
||
20 | 20 | ||
21 | try { |
||
22 | $result = \call_user_func($callback); |
||
23 | 20 | \restore_error_handler(); |
|
24 | 7 | return $result; |
|
25 | 7 | } catch (\Exception $e) { |
|
|
|||
26 | 13 | } catch (\Throwable $e) { |
|
27 | 5 | } |
|
28 | |||
29 | \restore_error_handler(); |
||
30 | 13 | throw $e; |
|
31 | 13 | } |
|
55 |