1 | <?php |
||
14 | class Decorator implements ExceptionHandler |
||
15 | { |
||
16 | /** |
||
17 | * @author Andrea Marco Sartori |
||
18 | * @var Illuminate\Contracts\Debug\ExceptionHandler $handler Laravel default exception handler. |
||
19 | */ |
||
20 | protected $handler; |
||
21 | |||
22 | /** |
||
23 | * @author Andrea Marco Sartori |
||
24 | * @var Cerbero\ExceptionHandler\Repository $handlers Custom exception handlers bag. |
||
25 | */ |
||
26 | protected $handlers; |
||
27 | |||
28 | /** |
||
29 | * Set the dependencies. |
||
30 | * |
||
31 | * @author Andrea Marco Sartori |
||
32 | * @param Illuminate\Contracts\Debug\ExceptionHandler $handler |
||
33 | * @param Cerbero\ExceptionHandler\Repository $handlers |
||
34 | * @return void |
||
|
|||
35 | */ |
||
36 | 21 | public function __construct(ExceptionHandler $handler, Repository $handlers) |
|
42 | |||
43 | /** |
||
44 | * Report or log an exception. |
||
45 | * |
||
46 | * @param \Exception $e |
||
47 | * @return void |
||
48 | */ |
||
49 | 3 | public function report(Exception $e) |
|
57 | |||
58 | /** |
||
59 | * Register a custom handler to report exceptions. |
||
60 | * |
||
61 | * @author Andrea Marco Sartori |
||
62 | * @param \Closure $reporter |
||
63 | * @return integer |
||
64 | */ |
||
65 | 3 | public function reporter(Closure $reporter) |
|
69 | |||
70 | /** |
||
71 | * Render an exception into an HTTP response. |
||
72 | * |
||
73 | * @param \Illuminate\Http\Request $request |
||
74 | * @param \Exception $e |
||
75 | * @return \Symfony\Component\HttpFoundation\Response |
||
76 | */ |
||
77 | 3 | public function render($request, Exception $e) |
|
87 | |||
88 | /** |
||
89 | * Register a custom handler to render exceptions. |
||
90 | * |
||
91 | * @author Andrea Marco Sartori |
||
92 | * @param \Closure $renderer |
||
93 | * @return integer |
||
94 | */ |
||
95 | 3 | public function renderer(Closure $renderer) |
|
99 | |||
100 | /** |
||
101 | * Render an exception to the console. |
||
102 | * |
||
103 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
104 | * @param \Exception $e |
||
105 | * @return void |
||
106 | */ |
||
107 | 3 | public function renderForConsole($output, Exception $e) |
|
115 | |||
116 | /** |
||
117 | * Register a custom handler to render exceptions to the console. |
||
118 | * |
||
119 | * @author Andrea Marco Sartori |
||
120 | * @param \Closure $renderer |
||
121 | * @return integer |
||
122 | */ |
||
123 | 3 | public function consoleRenderer(Closure $renderer) |
|
127 | } |
||
128 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.