Total Complexity | 4 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class Builder implements TokenBuilder |
||
13 | { |
||
14 | private const CLAIM_TO_METHOD = [ |
||
15 | Claims::SUBJECT => 'relatedTo', |
||
16 | Claims::ISSUER => 'issuedBy', |
||
17 | Claims::AUDIENCE => 'permittedFor', |
||
18 | Claims::ISSUED_AT => 'issuedAt', |
||
19 | Claims::NOT_BEFORE => 'canOnlyBeUsedAfter', |
||
20 | Claims::EXPIRATION_TIME => 'expiresAt', |
||
21 | Claims::ID => 'identifiedBy', |
||
22 | ]; |
||
23 | |||
24 | private $config; |
||
25 | private $claims; |
||
26 | |||
27 | public function __construct(JwtConfiguration $config, Claims $claims) |
||
28 | { |
||
29 | $this->config = $config; |
||
30 | $this->claims = $claims; |
||
31 | } |
||
32 | |||
33 | public function fromUser(UserInterface $user): string |
||
48 | } |
||
49 | } |
||
50 |