Issues (7)

examples/index.php (1 issue)

Labels
Severity
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
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