Skip to content

problem with Builder #757

Answered by Ocramius
R3B4T0 asked this question in Q&A
Jun 9, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

By default, the Builder is something you can get from a Lcobucci\JWT\Configuration instance, as explained in https://github.com/lcobucci/jwt/blob/207955dfbce28b4fbdc12367fbccf9546c66eb2d/docs/issuing-tokens.md

The Configuration#builder() uses a closure internally to give you a clean Builder each time:

jwt/src/Configuration.php

Lines 104 to 107 in 207955d

public function builder(?ClaimsFormatter $claimFormatter = null): Builder
{
return ($this->builderFactory)($claimFormatter ?? ChainedFormatter::default());
}

$this->builderFactory = static function (ClaimsFormatter $claimFormatter) use ($encoder

Replies: 1 comment 2 replies

Comment options

Ocramius
Jun 9, 2021
Collaborator Sponsor

You must be logged in to vote
2 replies
@R3B4T0
Comment options

@Slamdunk
Comment options

Answer selected by Ocramius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants