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 repository. |
||
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) |
|
59 | |||
60 | /** |
||
61 | * Register a custom handler to report exceptions. |
||
62 | * |
||
63 | * @author Andrea Marco Sartori |
||
64 | * @param \Closure $reporter |
||
65 | * @return integer |
||
66 | */ |
||
67 | 3 | public function reporter(Closure $reporter) |
|
71 | |||
72 | /** |
||
73 | * Render an exception into an HTTP response. |
||
74 | * |
||
75 | * @param \Illuminate\Http\Request $request |
||
76 | * @param \Exception $e |
||
77 | * @return \Symfony\Component\HttpFoundation\Response |
||
78 | */ |
||
79 | 3 | public function render($request, Exception $e) |
|
89 | |||
90 | /** |
||
91 | * Register a custom handler to render exceptions. |
||
92 | * |
||
93 | * @author Andrea Marco Sartori |
||
94 | * @param \Closure $renderer |
||
95 | * @return integer |
||
96 | */ |
||
97 | 3 | public function renderer(Closure $renderer) |
|
101 | |||
102 | /** |
||
103 | * Render an exception to the console. |
||
104 | * |
||
105 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
106 | * @param \Exception $e |
||
107 | * @return void |
||
108 | */ |
||
109 | 3 | public function renderForConsole($output, Exception $e) |
|
119 | |||
120 | /** |
||
121 | * Register a custom handler to render exceptions to the console. |
||
122 | * |
||
123 | * @author Andrea Marco Sartori |
||
124 | * @param \Closure $renderer |
||
125 | * @return integer |
||
126 | */ |
||
127 | 3 | public function consoleRenderer(Closure $renderer) |
|
131 | } |
||
132 |
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.