1 | <?php |
||
21 | class StorableJWKSet implements StorableJWKSetInterface |
||
22 | { |
||
23 | use Storable; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $parameters; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $nb_keys; |
||
34 | |||
35 | /** |
||
36 | * StorableJWKSet constructor. |
||
37 | * |
||
38 | * @param string $filename |
||
39 | * @param array $parameters |
||
40 | * @param int $nb_keys |
||
41 | */ |
||
42 | public function __construct($filename, array $parameters, $nb_keys) |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function current() |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function next() |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function key() |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function valid() |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function rewind() |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function offsetExists($offset) |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | public function offsetGet($offset) |
||
106 | |||
107 | /** |
||
108 | * {@inheritdoc} |
||
109 | */ |
||
110 | public function offsetSet($offset, $value) |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function offsetUnset($offset) |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | public function getKey($index) |
||
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | public function hasKey($index) |
||
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | public function getKeys() |
||
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | public function addKey(JWKInterface $key) |
||
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | public function removeKey($index) |
||
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function countKeys() |
||
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | public function selectKey($type, $algorithm = null, array $restrictions = []) |
||
178 | |||
179 | /** |
||
180 | * {@inheritdoc} |
||
181 | */ |
||
182 | public function count() |
||
186 | |||
187 | /** |
||
188 | * {@inheritdoc} |
||
189 | */ |
||
190 | public function jsonSerialize() |
||
194 | |||
195 | /** |
||
196 | * @return \Jose\Object\JWKSetInterface |
||
197 | */ |
||
198 | protected function getJWKSet() |
||
204 | |||
205 | /** |
||
206 | * @param array $file_content |
||
207 | * |
||
208 | * @return \JsonSerializable |
||
209 | */ |
||
210 | protected function createObjectFromFileContent(array $file_content) |
||
214 | |||
215 | /** |
||
216 | * This method creates the JWKSet and populate it with keys. |
||
217 | */ |
||
218 | protected function createNewObject() |
||
228 | |||
229 | /** |
||
230 | * @return \Jose\Object\JWKInterface |
||
231 | */ |
||
232 | protected function createJWK() |
||
239 | } |
||
240 |
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.