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 = []) |
||
131 | |||
132 | /** |
||
133 | * validate method |
||
134 | * |
||
135 | * @throws InaccessibleException |
||
136 | * @throws MalformedException |
||
137 | * @throws TokenExpiredException |
||
138 | */ |
||
139 | protected function validate() |
||
159 | |||
160 | /** |
||
161 | * validateAccessible method |
||
162 | * |
||
163 | * @throws InaccessibleException |
||
164 | */ |
||
165 | public function validateAccessible() |
||
173 | |||
174 | /** |
||
175 | * toArray method |
||
176 | * |
||
177 | * @return array |
||
178 | */ |
||
179 | public function toArray() |
||
199 | |||
200 | } |