Passed
Branch v1.6.0 (c77ef3)
by Wanderson
01:54
created

ErrorsController::error404()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
namespace App\Controllers;
4
5
use Exception;
6
use Win\Controllers\Controller;
7
use Win\Views\View;
8
9
/**
10
 * Páginas de Erros 
11
 * 404, 500, etc
12
 */
13
class ErrorsController extends Controller
14
{
15
	/** @var Exception */
16
	public $exception;
17
18
	public function _404(Exception $e)
19
	{
20
		http_response_code(404);
21
		$this->title = 'Página não encontrada';
22
		$this->exception = $e;
23
24
		return new View('errors/404');
25
	}
26
27
	public function _503(Exception $e)
28
	{
29
		http_response_code(503);
30
		$this->layout = null;
31
		$this->title = 'Ocorreu um erro';
32
		$this->exception = $e;
33
		
34
		return new View('errors/503');
35
	}
36
}
37