1 | <?php |
||
11 | class Claim |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * subject |
||
16 | * |
||
17 | * @var mixed |
||
18 | */ |
||
19 | public $sub; |
||
20 | |||
21 | /** |
||
22 | * issuer |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | public $iss; |
||
27 | |||
28 | /** |
||
29 | * audience |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | public $aud; |
||
34 | |||
35 | /** |
||
36 | * issued at |
||
37 | * |
||
38 | * @var int |
||
39 | */ |
||
40 | public $iat; |
||
41 | |||
42 | /** |
||
43 | * expiration time |
||
44 | * |
||
45 | * @var int |
||
46 | */ |
||
47 | public $exp; |
||
48 | |||
49 | /** |
||
50 | * not before |
||
51 | * |
||
52 | * @var int |
||
53 | */ |
||
54 | public $nbf; |
||
55 | |||
56 | /** |
||
57 | * not after |
||
58 | * |
||
59 | * @var int |
||
60 | */ |
||
61 | public $nat; |
||
62 | |||
63 | /** |
||
64 | * JWT identity |
||
65 | * |
||
66 | * @var string |
||
67 | */ |
||
68 | public $jti; |
||
69 | |||
70 | /** |
||
71 | * leeway for using in comparing time |
||
72 | * |
||
73 | * @var int |
||
74 | */ |
||
75 | public $leeway; |
||
76 | |||
77 | /** |
||
78 | * refreshable - whether the token can be refreshed |
||
79 | * |
||
80 | * @var bool |
||
81 | */ |
||
82 | public $refresh = false; |
||
83 | |||
84 | /** |
||
85 | * timestamp when this object is instantiate |
||
86 | * |
||
87 | * @var int |
||
88 | */ |
||
89 | protected $now; |
||
90 | |||
91 | /** |
||
92 | * Claim constructor |
||
93 | * |
||
94 | * @param array $data |
||
95 | * @throws InaccessibleException |
||
96 | * @throws MalformedException |
||
97 | * @throws TokenExpiredException |
||
98 | */ |
||
99 | public function __construct(array $data = []) |
||
117 | |||
118 | /** |
||
119 | * getDataMergedWithDefault method |
||
120 | * |
||
121 | * @param array $data |
||
122 | * @return array |
||
123 | */ |
||
124 | protected function getDataMergedWithDefault(array $data = []) |
||
140 | |||
141 | /** |
||
142 | * generateJti method |
||
143 | */ |
||
144 | protected function generateJti() |
||
150 | |||
151 | /** |
||
152 | * validate method |
||
153 | * |
||
154 | * @throws InaccessibleException |
||
155 | * @throws MalformedException |
||
156 | * @throws TokenExpiredException |
||
157 | */ |
||
158 | protected function validate() |
||
178 | |||
179 | /** |
||
180 | * validateAccessible method |
||
181 | * |
||
182 | * @throws InaccessibleException |
||
183 | */ |
||
184 | public function validateAccessible() |
||
192 | |||
193 | /** |
||
194 | * toArray method |
||
195 | * |
||
196 | * @return array |
||
197 | */ |
||
198 | public function toArray() |
||
218 | |||
219 | } |