Issues (42)

config/routes.php (1 issue)

1
<?php
2
3
use \App\Khan\Component\Router\Router;
4
5
Container::bind("teste", function () {
6
	return "Init development!!";
7
});
8
9
Router\notFound(function ($req, $res) {
10
	$res->setStatusCode(404);
11
	return die("Route not found insert in router!!");
12
});
13
14
Router\get('/', function ($req, $res) {
15
	$message = Container::get('teste')();
16
	$res->render('index.html', [
17
		'message' => $message,
18
	]);
19
});
20
21
Router\get('/form', function ($req, $res) {
22
	return $res->render('csrf.html');
23
});
24
25
Router\post('/form', function ($req, $res) {
0 ignored issues
show
The parameter $res is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

25
Router\post('/form', function ($req, /** @scrutinizer ignore-unused */ $res) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
	return Router\Router::csrf_token_verify($req->post('token'))
27
	? 'verdadeiro' : 'falso';
28
});
29
30
Router\get('/teste', "Controllers\TesteController->index");
31