for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Test;
use CoffeeCode\Router\Router;
class Name
{
/** @var Router */
private $router;
public function __construct($router)
$this->router = $router;
}
public function home(): void
echo "<h1>Home</h1>";
echo "<p>", $this->router->route("name.home"), "</p>";
echo "<p>", $this->router->route("name.hello"), "</p>";
echo "<p>", $this->router->route("name.redirect"), "</p>";
public function hello($data): void
$data
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function hello(/** @scrutinizer ignore-unused */ $data): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
echo "<h1>Hello World</h1>";
echo "<a href='{$this->router->route("name.params", ["category" => 6, "page" => 1])}'>Route Params</a>";
public function params(array $data): void
var_dump($data, $this->router->current());
var_dump($data, $this->router->current())
public function redirect($data): void
if ($data) {
//$data = category => *, page => *
$this->router->redirect("name.params", $data);
$this->router->redirect("name.hello");
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.