1010use Lcobucci \JWT \Signer \InvalidKeyProvided ;
1111use Lcobucci \JWT \Signer \Key ;
1212use Lcobucci \JWT \Token \RegisteredClaimGiven ;
13+ use NoDiscard ;
1314
1415/** @immutable */
1516interface Builder
@@ -19,49 +20,57 @@ interface Builder
1920 *
2021 * @param non-empty-string ...$audiences
2122 */
23+ #[NoDiscard]
2224 public function permittedFor (string ...$ audiences ): Builder ;
2325
2426 /**
2527 * Configures the expiration time
2628 */
29+ #[NoDiscard]
2730 public function expiresAt (DateTimeImmutable $ expiration ): Builder ;
2831
2932 /**
3033 * Configures the token id
3134 *
3235 * @param non-empty-string $id
3336 */
37+ #[NoDiscard]
3438 public function identifiedBy (string $ id ): Builder ;
3539
3640 /**
3741 * Configures the time that the token was issued
3842 */
43+ #[NoDiscard]
3944 public function issuedAt (DateTimeImmutable $ issuedAt ): Builder ;
4045
4146 /**
4247 * Configures the issuer
4348 *
4449 * @param non-empty-string $issuer
4550 */
51+ #[NoDiscard]
4652 public function issuedBy (string $ issuer ): Builder ;
4753
4854 /**
4955 * Configures the time before which the token cannot be accepted
5056 */
57+ #[NoDiscard]
5158 public function canOnlyBeUsedAfter (DateTimeImmutable $ notBefore ): Builder ;
5259
5360 /**
5461 * Configures the subject
5562 *
5663 * @param non-empty-string $subject
5764 */
65+ #[NoDiscard]
5866 public function relatedTo (string $ subject ): Builder ;
5967
6068 /**
6169 * Configures a header item
6270 *
6371 * @param non-empty-string $name
6472 */
73+ #[NoDiscard]
6574 public function withHeader (string $ name , mixed $ value ): Builder ;
6675
6776 /**
@@ -71,6 +80,7 @@ public function withHeader(string $name, mixed $value): Builder;
7180 *
7281 * @throws RegisteredClaimGiven When trying to set a registered claim.
7382 */
83+ #[NoDiscard]
7484 public function withClaim (string $ name , mixed $ value ): Builder ;
7585
7686 /**
@@ -81,5 +91,6 @@ public function withClaim(string $name, mixed $value): Builder;
8191 * @throws InvalidKeyProvided When issue key is invalid/incompatible.
8292 * @throws ConversionFailed When signature could not be converted.
8393 */
94+ #[NoDiscard]
8495 public function getToken (Signer $ signer , Key $ key ): UnencryptedToken ;
8596}
0 commit comments