for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace GacelaTest\Feature\Router\Fixtures;
final class FakeController
{
public function basicAction(): string
return 'Expected!';
}
public function stringParamAction(string $param): string
$type = get_debug_type($param);
return "The '{$type}' param is '{$param}'!";
public function intParamAction(int $param): string
public function floatParamAction(float $param): string
public function boolParamAction(bool $param): string
$stringParam = json_encode($param);
return "The '{$type}' param is '{$stringParam}'!";
public function manyParamsAction(string $firstParam, string $secondParam, string $thirdParam): string
return "The params are '{$firstParam}', '{$secondParam}' and '{$thirdParam}'!";
/**
* @param mixed $param
*/
public function nonTypedParam($param): string
$param
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function nonTypedParam(/** @scrutinizer ignore-unused */ $param): string
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return 'I AM ERROR!';
public function nonScalarParam(array $param): string
public function nonScalarParam(/** @scrutinizer ignore-unused */ array $param): string
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.