anonymous()
last analyzed

Size

Total Lines 2
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
nc 2
nop 2
dl 0
loc 2
c 0
b 0
f 0
1
<?php
2
3
use \App\Khan\Component\Router\Router;
4
5
Container::bind("teste", function () {
0 ignored issues
show
Bug introduced by
The type Container was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
	return "Init development!!";
7
});
8
9
Router\notFound(function ($req, $res) {
0 ignored issues
show
Bug introduced by
The function notFound was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

9
/** @scrutinizer ignore-call */ 
10
Router\notFound(function ($req, $res) {
Loading history...
10
	$res->setStatusCode(404);
11
	return die("Route not found insert in router!!");
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
12
});
13
14
Router\get('/', function ($req, $res) {
0 ignored issues
show
Bug introduced by
The function get was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

14
/** @scrutinizer ignore-call */ 
15
Router\get('/', function ($req, $res) {
Loading history...
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
Bug introduced by
The function post was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

25
/** @scrutinizer ignore-call */ 
26
Router\post('/form', function ($req, $res) {
Loading history...
Unused Code introduced by
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