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 | * issued at |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | public $iat; |
||
34 | |||
35 | /** |
||
36 | * expiration time |
||
37 | * |
||
38 | * @var int |
||
39 | */ |
||
40 | public $exp; |
||
41 | |||
42 | /** |
||
43 | * not before |
||
44 | * |
||
45 | * @var int |
||
46 | */ |
||
47 | public $nbf; |
||
48 | |||
49 | /** |
||
50 | * not after |
||
51 | * |
||
52 | * @var int |
||
53 | */ |
||
54 | public $nat; |
||
55 | |||
56 | /** |
||
57 | * JWT identity |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | public $jti; |
||
62 | |||
63 | /** |
||
64 | * leeway for using in comparing time |
||
65 | * |
||
66 | * @var int |
||
67 | */ |
||
68 | public $leeway; |
||
69 | |||
70 | /** |
||
71 | * Claim constructor |
||
72 | * |
||
73 | * @param array $data |
||
74 | * @throws InaccessibleException |
||
75 | * @throws MalformedException |
||
76 | * @throws TokenExpiredException |
||
77 | */ |
||
78 | public function __construct(array $data = []) |
||
114 | |||
115 | /** |
||
116 | * validate method |
||
117 | * |
||
118 | * @throws InaccessibleException |
||
119 | * @throws MalformedException |
||
120 | * @throws TokenExpiredException |
||
121 | */ |
||
122 | protected function validate() |
||
138 | |||
139 | /** |
||
140 | * toArray method |
||
141 | * |
||
142 | * @return array |
||
143 | */ |
||
144 | public function toArray() |
||
178 | |||
179 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.