1 | <?php |
||
21 | class StorableJWKSet implements StorableInterface, JWKSetInterface |
||
22 | { |
||
23 | use Storable; |
||
24 | use JWKSetPEM; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $parameters; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $nb_keys; |
||
35 | |||
36 | /** |
||
37 | * StorableJWKSet constructor. |
||
38 | * |
||
39 | * @param string $filename |
||
40 | * @param array $parameters |
||
41 | * @param int $nb_keys |
||
42 | */ |
||
43 | public function __construct($filename, array $parameters, $nb_keys) |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function current() |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function next() |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function key() |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function valid() |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function rewind() |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function offsetExists($offset) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function offsetGet($offset) |
||
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | public function offsetSet($offset, $value) |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | public function offsetUnset($offset) |
||
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | public function getKey($index) |
||
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | public function hasKey($index) |
||
139 | |||
140 | /** |
||
141 | * {@inheritdoc} |
||
142 | */ |
||
143 | public function getKeys() |
||
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | public function addKey(JWKInterface $key) |
||
155 | |||
156 | /** |
||
157 | * {@inheritdoc} |
||
158 | */ |
||
159 | public function prependKey(JWKInterface $key) |
||
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | public function removeKey($index) |
||
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | */ |
||
175 | public function countKeys() |
||
179 | |||
180 | /** |
||
181 | * {@inheritdoc} |
||
182 | */ |
||
183 | public function selectKey($type, $algorithm = null, array $restrictions = []) |
||
187 | |||
188 | /** |
||
189 | * {@inheritdoc} |
||
190 | */ |
||
191 | public function count() |
||
195 | |||
196 | /** |
||
197 | * {@inheritdoc} |
||
198 | */ |
||
199 | public function jsonSerialize() |
||
203 | |||
204 | /** |
||
205 | * @return \Jose\Object\JWKSetInterface |
||
206 | */ |
||
207 | protected function getJWKSet() |
||
213 | |||
214 | /** |
||
215 | * @param array $file_content |
||
216 | * |
||
217 | * @return \JsonSerializable |
||
218 | */ |
||
219 | protected function createObjectFromFileContent(array $file_content) |
||
223 | |||
224 | /** |
||
225 | * This method creates the JWKSet and populate it with keys. |
||
226 | */ |
||
227 | protected function createNewObject() |
||
237 | |||
238 | /** |
||
239 | * @return \Jose\Object\JWKInterface |
||
240 | */ |
||
241 | protected function createJWK() |
||
248 | } |
||
249 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.