Total Complexity | 6 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class OutputHelper |
||
10 | { |
||
11 | /** |
||
12 | * Call a user function given with an array of parameters and catch its output. |
||
13 | * @param callable $callback function to be called |
||
14 | * @param array $arguments parameters to be passed to the function, as an indexed array |
||
15 | * @return array array containing result returned by function and its output. |
||
16 | * @throws \Exception|\Throwable |
||
17 | */ |
||
18 | public static function catchOutput($callback, $arguments = []) |
||
37 | } |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Closes the output buffer opened above if it has not been closed already. |
||
42 | * @param int $obInitialLevel initial level of the output buffering mechanism |
||
43 | */ |
||
44 | protected static function exceptionHandler($obInitialLevel) |
||
53 |