public function testGetMutable_validators() { $jwt = new Jwt($this->srcJwt, $this->secret); $validators = [function () { return true; }, function () { return false; }]; $jwt->addValidator(...$validators); $mutable = $jwt->getMutable(); $this->assertEquals($validators, $mutable->getValidators()->get()); }
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; }