1 | <?php |
||
13 | class Handler{ |
||
|
|||
14 | |||
15 | /** |
||
16 | * Constructor |
||
17 | * |
||
18 | */ |
||
19 | private function __construct(){} |
||
20 | |||
21 | /** |
||
22 | * Register the error and exception handlers. |
||
23 | * Must be called at the beginning of your application |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | public static function register(){ |
||
37 | |||
38 | /** |
||
39 | * Handle fatal errors |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public static function handleFatalError(){ |
||
59 | |||
60 | /** |
||
61 | * Handle errors |
||
62 | * |
||
63 | * @return void |
||
64 | * @throws ErrorException |
||
65 | */ |
||
66 | public static function handleError($errno, $errmsg, $filename, $linenum, $vars){ |
||
69 | |||
70 | /** |
||
71 | * Handle & log exceptions |
||
72 | * |
||
73 | * @return void |
||
74 | * @see http://php.net/manual/en/function.set-exception-handler.php |
||
75 | */ |
||
76 | public static function handleException($e) { |
||
80 | |||
81 | /** |
||
82 | * display system error page as result of an error or exception |
||
83 | * |
||
84 | * @param Exception $e |
||
85 | * @return Response |
||
86 | */ |
||
87 | private static function render(Exception $e){ |
||
95 | |||
96 | /** |
||
97 | * Map an error code to error text |
||
98 | * |
||
99 | * @param int $errno |
||
100 | * @return string error text |
||
101 | */ |
||
102 | private static function errorType($errno){ |
||
123 | |||
124 | } |
||
125 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.