示例#1
0
文件: Jwt.php 项目: maarky/jwt
 public function getImmutable() : ImmutableJwt
 {
     $jwt = new ImmutableJwt($this->encode());
     if (!is_null($this->secret)) {
         $jwt->setSecret($this->getSecret()->get());
     }
     $validators = $this->getValidators();
     if ($validators->isDefined()) {
         $jwt->addValidator(...$validators->get());
     }
     $jwt->trusted = false;
     return $jwt;
 }