for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace xiaodi\JWTAuth;
use Lcobucci\JWT\Token;
use xiaodi\JWTAuth\Blacklist;
class Manager
{
private $blacklist;
public function __construct(Blacklist $blacklist)
$this->blacklist = $blacklist;
}
public function login(Token $token)
$token
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function login(/** @scrutinizer ignore-unused */ Token $token)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
public function logout(Token $token)
$this->blacklist->add($token);
public function refresh(Token $token)
public function refresh(/** @scrutinizer ignore-unused */ Token $token)
/**
* Undocumented function
*
* @param Token $token
* @return boolean
*/
public function hasBlacklist(Token $token)
return $this->blacklist->add($token);
return $this->blacklist->add($token)
void
boolean
$this->blacklist->add($token)
xiaodi\JWTAuth\Blacklist::add()
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.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.