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;
class Manager
{
private $blacklist;
public function __construct(Blacklist $blacklist)
$this->blacklist = $blacklist;
}
/**
* 处理登录时.
*
* @param Token $token
* @return void
*/
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.
// TODO 但凡获取新token后 都把以前的注销(黑名单)
// $jti = $token->getClaim('jti');
* 处理登出时.
public function logout(Token $token)
$this->blacklist->add($token);
* 处理刷新时.
public function refresh(Token $token)
// 注销此Token
$this->logout($token);
* 是否存在黑名单.
* @return bool
public function hasBlacklist(Token $token)
return $this->blacklist->has($token);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.