| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 32 | 3 | public function sign(array $attributes): string |
|
| 33 | { |
||
| 34 | 3 | $time = time(); |
|
| 35 | |||
| 36 | 3 | $builder = Build::jws() |
|
| 37 | 3 | ->exp($time + 3600) |
|
| 38 | 3 | ->iat($time) |
|
| 39 | 3 | ->nbf($time) |
|
| 40 | 3 | ->jti($this->jti, true) |
|
| 41 | 3 | ->alg($this->algorithm) |
|
| 42 | 3 | ->iss($this->issuer) |
|
| 43 | 3 | ->sub($this->subject); |
|
| 44 | |||
| 45 | 3 | foreach ($attributes as $key => $value) { |
|
| 46 | 3 | $builder->claim($key, $value, true); |
|
| 47 | } |
||
| 48 | |||
| 49 | 3 | return $builder->sign($this->jwk->get(0)); |
|
| 50 | } |
||
| 51 | } |