1 | <?php |
||
11 | class ExceptionAsString |
||
12 | { |
||
13 | 3 | public function summery(\Exception $e, $log) |
|
17 | |||
18 | /** |
||
19 | * @param \Exception $e |
||
20 | * @param Request $request |
||
21 | * |
||
22 | * @return string |
||
23 | */ |
||
24 | 3 | public function detail(\Exception $e, Request $request) |
|
37 | |||
38 | /** |
||
39 | * @param array $server |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | 3 | private function getPhpVariables(array $server) |
|
51 | } |
||
52 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: