1 | <?php |
||
21 | class StorableJWKSet implements StorableJWKSetInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var \Jose\Object\JWKSetInterface |
||
25 | */ |
||
26 | protected $jwkset; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $filename; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $parameters; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $nb_keys; |
||
42 | |||
43 | /** |
||
44 | * @var null|int |
||
45 | */ |
||
46 | protected $file_last_modification_time = null; |
||
47 | |||
48 | /** |
||
49 | * StorableJWKSet constructor. |
||
50 | * |
||
51 | * @param string $filename |
||
52 | * @param array $parameters |
||
53 | * @param int $nb_keys |
||
54 | */ |
||
55 | public function __construct($filename, array $parameters, $nb_keys) |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function current() |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function next() |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function key() |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function valid() |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function rewind() |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function offsetExists($offset) |
||
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | public function offsetGet($offset) |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function offsetSet($offset, $value) |
||
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | public function offsetUnset($offset) |
||
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | public function getKey($index) |
||
145 | |||
146 | /** |
||
147 | * {@inheritdoc} |
||
148 | */ |
||
149 | public function hasKey($index) |
||
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | public function getKeys() |
||
161 | |||
162 | /** |
||
163 | * {@inheritdoc} |
||
164 | */ |
||
165 | public function addKey(JWKInterface $key) |
||
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | public function removeKey($index) |
||
177 | |||
178 | /** |
||
179 | * {@inheritdoc} |
||
180 | */ |
||
181 | public function countKeys() |
||
185 | |||
186 | /** |
||
187 | * {@inheritdoc} |
||
188 | */ |
||
189 | public function selectKey($type, $algorithm = null, array $restrictions = []) |
||
193 | |||
194 | /** |
||
195 | * {@inheritdoc} |
||
196 | */ |
||
197 | public function count() |
||
201 | |||
202 | /** |
||
203 | * {@inheritdoc} |
||
204 | */ |
||
205 | public function jsonSerialize() |
||
206 | { |
||
207 | return $this->getJWKSet()->jsonSerialize(); |
||
208 | } |
||
209 | |||
210 | /** |
||
211 | * @return string |
||
212 | */ |
||
213 | protected function getFilename() |
||
214 | { |
||
215 | return $this->filename; |
||
216 | } |
||
217 | |||
218 | /** |
||
219 | * @return \Jose\Object\JWKSetInterface |
||
220 | */ |
||
221 | protected function getJWKSet() |
||
227 | |||
228 | /** |
||
229 | * This function loads or creates it the file if needed |
||
230 | */ |
||
231 | protected function loadJWKSetIfNeeded() |
||
244 | |||
245 | /** |
||
246 | * @return bool |
||
247 | */ |
||
248 | protected function hasFileBeenUpdated() |
||
256 | |||
257 | protected function getFileLastModificationTime() |
||
263 | |||
264 | /** |
||
265 | * This function returns the content of the file only if it is an array |
||
266 | * |
||
267 | * @return null|array |
||
268 | */ |
||
269 | protected function getFileContent() |
||
285 | |||
286 | /** |
||
287 | * This method creates the JWKSet and populate it with keys |
||
288 | */ |
||
289 | protected function createJWKSet() |
||
299 | |||
300 | /** |
||
301 | * @return \Jose\Object\JWKInterface |
||
302 | */ |
||
303 | protected function createJWK() |
||
310 | |||
311 | /** |
||
312 | * This method saves the JWKSet in the file. |
||
313 | */ |
||
314 | protected function save() |
||
320 | } |
||
321 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..