diff --git a/src/Token/Builder.php b/src/Token/Builder.php index d92d41e1..355766b7 100644 --- a/src/Token/Builder.php +++ b/src/Token/Builder.php @@ -29,6 +29,10 @@ public function __construct(private readonly Encoder $encoder, private readonly { } + /** + * @inheritDoc + * @pure + */ public function permittedFor(string ...$audiences): BuilderInterface { $configured = $this->claims[RegisteredClaims::AUDIENCE] ?? []; @@ -37,36 +41,64 @@ public function permittedFor(string ...$audiences): BuilderInterface return $this->setClaim(RegisteredClaims::AUDIENCE, array_merge($configured, $toAppend)); } + /** + * @inheritDoc + * @pure + */ public function expiresAt(DateTimeImmutable $expiration): BuilderInterface { return $this->setClaim(RegisteredClaims::EXPIRATION_TIME, $expiration); } + /** + * @inheritDoc + * @pure + */ public function identifiedBy(string $id): BuilderInterface { return $this->setClaim(RegisteredClaims::ID, $id); } + /** + * @inheritDoc + * @pure + */ public function issuedAt(DateTimeImmutable $issuedAt): BuilderInterface { return $this->setClaim(RegisteredClaims::ISSUED_AT, $issuedAt); } + /** + * @inheritDoc + * @pure + */ public function issuedBy(string $issuer): BuilderInterface { return $this->setClaim(RegisteredClaims::ISSUER, $issuer); } + /** + * @inheritDoc + * @pure + */ public function canOnlyBeUsedAfter(DateTimeImmutable $notBefore): BuilderInterface { return $this->setClaim(RegisteredClaims::NOT_BEFORE, $notBefore); } + /** + * @inheritDoc + * @pure + */ public function relatedTo(string $subject): BuilderInterface { return $this->setClaim(RegisteredClaims::SUBJECT, $subject); } + /** + * @inheritDoc + * @pure + */ public function withHeader(string $name, mixed $value): BuilderInterface { $new = clone $this; @@ -75,6 +107,10 @@ public function withHeader(string $name, mixed $value): BuilderInterface return $new; } + /** + * @inheritDoc + * @pure + */ public function withClaim(string $name, mixed $value): BuilderInterface { if (in_array($name, RegisteredClaims::ALL, true)) {