Lcobucci\JWT\Token::hasClaim PHP Method

hasClaim() public method

Returns if the claim is configured
public hasClaim ( string $name ) : boolean
$name string
return boolean
    public function hasClaim(string $name) : bool
    {
        return array_key_exists($name, $this->claims);
    }

Usage Example

コード例 #1
0
 /**
  * @param Jwt $jwt
  * @return bool
  */
 public function validateRequiredClaims(Jwt $jwt)
 {
     foreach ($this->requiredClaims as $claim) {
         if (!$jwt->hasClaim($claim)) {
             return false;
         }
     }
     return true;
 }
All Usage Examples Of Lcobucci\JWT\Token::hasClaim