1 | <?php |
||
9 | trait TypedClaims |
||
10 | { |
||
11 | /** |
||
12 | * Check whether the claim is present. |
||
13 | * |
||
14 | * @param string $name Claim name |
||
15 | * @return bool |
||
16 | */ |
||
17 | abstract public function has($name); |
||
18 | |||
19 | /** |
||
20 | * Get the claim by name. |
||
21 | * |
||
22 | * @param string $name Claim name |
||
23 | * @return Claim |
||
24 | */ |
||
25 | abstract public function get($name); |
||
26 | |||
27 | /** |
||
28 | * Check whether the issuer claim is present. |
||
29 | * |
||
30 | * @return bool |
||
31 | */ |
||
32 | 1 | public function hasIssuer() { |
|
35 | |||
36 | /** |
||
37 | * Get the issuer claim. |
||
38 | * |
||
39 | * @return IssuerClaim |
||
40 | */ |
||
41 | 2 | public function issuer() { |
|
45 | |||
46 | /** |
||
47 | * Check whether the subject claim is present. |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | 1 | public function hasSubject() { |
|
54 | |||
55 | /** |
||
56 | * Get the subject claim. |
||
57 | * |
||
58 | * @return SubjectClaim |
||
59 | */ |
||
60 | 1 | public function subject() { |
|
64 | |||
65 | /** |
||
66 | * Check whether the audience claim is present. |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | 1 | public function hasAudience() { |
|
73 | |||
74 | /** |
||
75 | * Get the audience claim. |
||
76 | * |
||
77 | * @return AudienceClaim |
||
78 | */ |
||
79 | 1 | public function audience() { |
|
83 | |||
84 | /** |
||
85 | * Check whether the expiration time claim is present. |
||
86 | * |
||
87 | * @return bool |
||
88 | */ |
||
89 | 1 | public function hasExpirationTime() { |
|
92 | |||
93 | /** |
||
94 | * Get the expiration time claim. |
||
95 | * |
||
96 | * @return ExpirationTimeClaim |
||
97 | */ |
||
98 | 1 | public function expirationTime() { |
|
103 | |||
104 | /** |
||
105 | * Check whether the not before claim is present. |
||
106 | * |
||
107 | * @return bool |
||
108 | */ |
||
109 | 1 | public function hasNotBefore() { |
|
112 | |||
113 | /** |
||
114 | * Get the not before claim. |
||
115 | * |
||
116 | * @return NotBeforeClaim |
||
117 | */ |
||
118 | 1 | public function notBefore() { |
|
122 | |||
123 | /** |
||
124 | * Check whether the issued at claim is present. |
||
125 | * |
||
126 | * @return bool |
||
127 | */ |
||
128 | 1 | public function hasIssuedAt() { |
|
131 | |||
132 | /** |
||
133 | * Get the issued at claim. |
||
134 | * |
||
135 | * @return IssuedAtClaim |
||
136 | */ |
||
137 | 1 | public function issuedAt() { |
|
141 | |||
142 | /** |
||
143 | * Check whether the JWT ID claim is present. |
||
144 | * |
||
145 | * @return bool |
||
146 | */ |
||
147 | 1 | public function hasJWTID() { |
|
150 | |||
151 | /** |
||
152 | * Get the JWT ID claim. |
||
153 | * |
||
154 | * @return JWTIDClaim |
||
155 | */ |
||
156 | 1 | public function JWTID() { |
|
160 | |||
161 | /** |
||
162 | * Check that the claim is an instance of the given class. |
||
163 | * |
||
164 | * @param Claim $claim Claim object |
||
165 | * @param string $cls Class name |
||
166 | * @throws \UnexpectedValueException |
||
167 | * @return Claim |
||
168 | */ |
||
169 | 8 | private static function _checkType(Claim $claim, $cls) { |
|
176 | } |
||
177 |