1 | <?php |
||
16 | trait TypedHeader |
||
17 | { |
||
18 | /** |
||
19 | * Whether parameters are present. |
||
20 | * |
||
21 | * @param string ...$names Parameter names |
||
22 | * @return bool |
||
23 | */ |
||
24 | abstract public function has(...$names); |
||
25 | |||
26 | /** |
||
27 | * Get a parameter. |
||
28 | * |
||
29 | * @param string $name Parameter name |
||
30 | * @return JWTParameter |
||
31 | */ |
||
32 | abstract public function get($name); |
||
33 | |||
34 | /** |
||
35 | * Check whether the algorithm parameter is present. |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | public function hasAlgorithm() { |
||
42 | |||
43 | /** |
||
44 | * Get the algorithm parameter. |
||
45 | * |
||
46 | * @throws \UnexpectedValueException |
||
47 | * @return AlgorithmParameter |
||
48 | */ |
||
49 | public function algorithm() { |
||
53 | |||
54 | /** |
||
55 | * Check whether the authentication tag parameter is present. |
||
56 | * |
||
57 | * @return bool |
||
58 | */ |
||
59 | 5 | public function hasAuthenticationTag() { |
|
62 | |||
63 | /** |
||
64 | * Get the authentication tag parameter. |
||
65 | * |
||
66 | * @throws \UnexpectedValueException |
||
67 | * @return AuthenticationTagParameter |
||
68 | */ |
||
69 | 4 | public function authenticationTag() { |
|
73 | |||
74 | /** |
||
75 | * Check whether the 'base64url-encode payload' parameter is present. |
||
76 | * |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function hasB64Payload() { |
||
82 | |||
83 | /** |
||
84 | * Get the 'base64url-encode payload' parameter. |
||
85 | * |
||
86 | * @throws \UnexpectedValueException |
||
87 | * @return B64PayloadParameter |
||
88 | */ |
||
89 | public function b64Payload() { |
||
93 | |||
94 | /** |
||
95 | * |
||
96 | * @param JWTParameter $param |
||
97 | * @param string $cls |
||
98 | * @throws \UnexpectedValueException |
||
99 | * @return JWTParameter |
||
100 | */ |
||
101 | 4 | private static function _checkType(JWTParameter $param, $cls) { |
|
108 | } |
||
109 |