Completed
Push — master ( 7a40c2...1518e6 )
by Edson
01:28
created

Home   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 3 1
1
<?php
2
3
echo "<pre>";
4
5
include '../vendor/autoload.php';
6
7
use Bonfim\Router\Request;
8
use Bonfim\Router\Response;
9
use Bonfim\Router\Route;
10
11
class Home
12
{
13
    public static function index(Request $request)
14
    {
15
        echo $request->get('name');
16
    }
17
}
18
19
Route::get('/', ['Home', 'index']);
20
21
Route::get('/test/@name/@id:[\d]{1,2}', function ($id, $name, Response $response) {
22
    return $response->withRedirect('/');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $response->withRedirect('/') targeting Bonfim\Router\Response::withRedirect() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
23
});
24