1 | <?php |
||
16 | class ErrorController extends AbstractController |
||
17 | { |
||
18 | |||
19 | private $exception; |
||
20 | |||
21 | /** |
||
22 | * ErrorController constructor. |
||
23 | * @param Request $request |
||
24 | * @param \Exception $e |
||
25 | * @codeCoverageIgnore |
||
26 | */ |
||
27 | public function __construct(Request $request, $e) |
||
32 | |||
33 | /** |
||
34 | * @return \Faulancer\Http\Response |
||
35 | * @codeCoverageIgnore |
||
36 | */ |
||
37 | public function displayError() |
||
38 | { |
||
39 | ob_end_clean(); |
||
40 | |||
41 | if (getenv('APPLICATION_ENV') || defined('APPLICATION_ENV') && APPLICATION_ENV === 'development') { |
||
42 | return $this->renderDebugPage(); |
||
43 | } |
||
44 | |||
45 | return $this->renderNotFoundPage(); |
||
46 | |||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return \Faulancer\Http\Response |
||
51 | * @codeCoverageIgnore |
||
52 | */ |
||
53 | private function renderDebugPage() |
||
79 | |||
80 | /** |
||
81 | * @codeCoverageIgnore |
||
82 | */ |
||
83 | private function renderNotFoundPage() |
||
87 | |||
88 | } |