Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1.0007 |
1 | <?php |
||
40 | 4 | public function getToken(array $claims = []) |
|
41 | { |
||
42 | 4 | $issuer = (string) $this->request->getUri(); |
|
43 | 4 | $issued_at = $this->config->getTimestamp(); |
|
44 | 4 | $expiration = $issued_at + $this->config->getTtl(); |
|
45 | 4 | $key = $this->config->getPublicKey(); |
|
46 | 4 | $algorithm = $this->config->getAlgorithm(); |
|
47 | $claims += [ |
||
48 | 4 | 'iss' => $issuer, |
|
49 | 4 | 'iat' => $issued_at, |
|
50 | 4 | 'exp' => $expiration, |
|
51 | ]; |
||
52 | 4 | return JWT::encode($claims, $key, $algorithm); |
|
53 | } |
||
54 | } |
||
56 |