1 | <?php |
||
26 | class ExceptionController |
||
27 | { |
||
28 | use ClassMapHandlerTrait; |
||
29 | |||
30 | private $viewHandler; |
||
31 | private $exceptionCodes; |
||
32 | private $showException; |
||
33 | |||
34 | 4 | public function __construct( |
|
43 | |||
44 | /** |
||
45 | * Converts an Exception to a Response. |
||
46 | * |
||
47 | * @param Request $request |
||
48 | * @param \Exception $exception |
||
49 | * @param DebugLoggerInterface|null $logger |
||
50 | * |
||
51 | * @throws \InvalidArgumentException |
||
52 | * |
||
53 | * @return Response |
||
54 | */ |
||
55 | 4 | public function showAction(Request $request, \Exception $exception, DebugLoggerInterface $logger = null) |
|
66 | |||
67 | /** |
||
68 | * @param \Exception $exception |
||
69 | * @param int $code |
||
70 | * @param array $templateData |
||
71 | * @param Request $request |
||
72 | * @param bool $showException |
||
73 | * |
||
74 | * @return View |
||
75 | */ |
||
76 | 4 | protected function createView(\Exception $exception, $code, array $templateData, Request $request, $showException) |
|
84 | |||
85 | /** |
||
86 | * Determines the status code to use for the response. |
||
87 | * |
||
88 | * @param \Exception $exception |
||
89 | * |
||
90 | * @return int |
||
91 | */ |
||
92 | 4 | protected function getStatusCode(\Exception $exception) |
|
106 | |||
107 | /** |
||
108 | * Determines the parameters to pass to the view layer. |
||
109 | * |
||
110 | * Overwrite it in a custom ExceptionController class to add additionally parameters |
||
111 | * that should be passed to the view layer. |
||
112 | * |
||
113 | * @param string $currentContent |
||
114 | * @param int $code |
||
115 | * @param \Exception $exception |
||
116 | * @param DebugLoggerInterface $logger |
||
117 | * |
||
118 | * @return array |
||
119 | */ |
||
120 | 4 | private function getTemplateData($currentContent, $code, \Exception $exception, DebugLoggerInterface $logger = null) |
|
131 | |||
132 | /** |
||
133 | * Gets and cleans any content that was already outputted. |
||
134 | * |
||
135 | * This code comes from Symfony and should be synchronized on a regular basis |
||
136 | * see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | 4 | private function getAndCleanOutputBuffering($startObLevel) |
|
149 | } |
||
150 |