Jose\Object\JWTInterface::hasClaim PHP Method

hasClaim() public method

public hasClaim ( string $key ) : boolean
$key string The key
return boolean
    public function hasClaim($key);

Usage Example

示例#1
0
 /**
  * {@inheritdoc}
  */
 public function checkClaim(JWTInterface $jwt)
 {
     if (!$jwt->hasClaim('iat')) {
         return [];
     }
     $iat = (int) $jwt->getClaim('iat');
     Assertion::lessOrEqualThan($iat, time(), 'The JWT is issued in the future.');
     return ['iat'];
 }
All Usage Examples Of Jose\Object\JWTInterface::hasClaim