for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
declare(strict_types=1);
namespace Spiral\App\Controller;
use Spiral\App\User\Role;
use Spiral\App\User\User;
use Spiral\Domain\Annotation\Guarded;
class DemoController
{
public function entity(User $user)
return $user->getName();
}
public function entity2(User $user, Role $role)
$user
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function entity2(/** @scrutinizer ignore-unused */ User $user, Role $role)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$role
public function entity2(User $user, /** @scrutinizer ignore-unused */ Role $role)
return 'ok';
* @Guarded()
* @return string
public function guardedButNoName()
#[Guarded()]
public function guardedButNoNameAttribute()
* @Guarded("do")
public function do()
#[Guarded(permission: 'do')]
public function doAttribute()
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.