Total Complexity | 4 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | final class JWT |
||
9 | { |
||
10 | /** |
||
11 | * Raw encoded payload of the JWT |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | private $encoded; |
||
16 | |||
17 | /** |
||
18 | * Merged value of protected and unprotected headers |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | private $headers; |
||
23 | |||
24 | /** |
||
25 | * The payload |
||
26 | * Should be array|string for handle wrapped JWT (i.e. JWS into a JWE) |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | private $payload; |
||
31 | |||
32 | /** |
||
33 | * JWT constructor. |
||
34 | * |
||
35 | * @param string $encoded |
||
36 | * @param array $headers |
||
37 | * @param array $payload |
||
38 | */ |
||
39 | 28 | public function __construct(string $encoded, array $headers, array $payload) |
|
44 | 28 | } |
|
45 | |||
46 | /** |
||
47 | * Get the raw encoded value of the JWT |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 2 | public function encoded(): string |
|
52 | { |
||
53 | 2 | return $this->encoded; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * Merged value of protected and unprotected headers |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | 19 | public function headers(): array |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * The JWT payload |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | 27 | public function payload(): array |
|
74 | } |
||
75 | } |
||
76 |