@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function resolve(UserInterface $user): array |
27 | 27 | { |
28 | - $reduce = function (array $acc, Claims $claims) use ($user): array { |
|
28 | + $reduce = function(array $acc, Claims $claims) use ($user): array { |
|
29 | 29 | return array_merge($acc, $claims->resolve($user)); |
30 | 30 | }; |
31 | 31 |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | |
67 | 67 | ->arrayNode('storage') |
68 | 68 | ->beforeNormalization() |
69 | - ->ifTrue(function (array $config): bool { |
|
69 | + ->ifTrue(function(array $config): bool { |
|
70 | 70 | return !isset($config[0]); |
71 | 71 | }) |
72 | - ->then(function (array $config): array { |
|
72 | + ->then(function(array $config): array { |
|
73 | 73 | return [ |
74 | 74 | ['type' => self::STORAGE_FIXED, 'tokens' => $config], |
75 | 75 | ]; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return (new ArrayNodeDefinition($name)) |
126 | 126 | ->beforeNormalization() |
127 | 127 | ->ifString() |
128 | - ->then(function (string $config): array { |
|
128 | + ->then(function(string $config): array { |
|
129 | 129 | return ['signer' => $config]; |
130 | 130 | }) |
131 | 131 | ->end() |
@@ -172,17 +172,17 @@ discard block |
||
172 | 172 | ->isRequired() |
173 | 173 | ->beforeNormalization() |
174 | 174 | ->ifString() |
175 | - ->then(function (string $config): array { |
|
175 | + ->then(function(string $config): array { |
|
176 | 176 | return ['signing_key' => $config]; |
177 | 177 | }) |
178 | 178 | ->end() |
179 | 179 | ->beforeNormalization() |
180 | - ->ifTrue(function (?array $config): bool { |
|
180 | + ->ifTrue(function(?array $config): bool { |
|
181 | 181 | $type = $config['type'] ?? self::SIGNER_SYMMETRIC; |
182 | 182 | |
183 | 183 | return self::SIGNER_ASYMMETRIC === $type; |
184 | 184 | }) |
185 | - ->then(function (array $config): array { |
|
185 | + ->then(function(array $config): array { |
|
186 | 186 | if (isset($config['signing_key'])) { |
187 | 187 | $config['signing_key'] = 'file://' . $config['signing_key']; |
188 | 188 | } |
@@ -199,25 +199,25 @@ discard block |
||
199 | 199 | }) |
200 | 200 | ->end() |
201 | 201 | ->validate() |
202 | - ->ifTrue(function (array $config): bool { |
|
202 | + ->ifTrue(function(array $config): bool { |
|
203 | 203 | return self::SIGNER_ASYMMETRIC === $config['type'] && empty($config['verification_key']); |
204 | 204 | }) |
205 | 205 | ->thenInvalid('Verification key must be specified for "asymmetric" signer.') |
206 | 206 | ->end() |
207 | 207 | ->validate() |
208 | - ->ifTrue(function (array $config): bool { |
|
208 | + ->ifTrue(function(array $config): bool { |
|
209 | 209 | return self::SIGNER_SYMMETRIC === $config['type'] && !in_array($config['algorithm'], self::SYMMETRIC_ALGOS); |
210 | 210 | }) |
211 | 211 | ->thenInvalid('HMAC algorithm must be specified for "symmetric" signer.') |
212 | 212 | ->end() |
213 | 213 | ->validate() |
214 | - ->ifTrue(function (array $config): bool { |
|
214 | + ->ifTrue(function(array $config): bool { |
|
215 | 215 | return self::SIGNER_ASYMMETRIC === $config['type'] && !in_array($config['algorithm'], self::ASYMMETRIC_ALGOS); |
216 | 216 | }) |
217 | 217 | ->thenInvalid('RSA or ECDSA algorithm must be specified for "asymmetric" signer.') |
218 | 218 | ->end() |
219 | 219 | ->validate() |
220 | - ->ifTrue(function (array $config): bool { |
|
220 | + ->ifTrue(function(array $config): bool { |
|
221 | 221 | if (self::SIGNER_SYMMETRIC === $config['type']) { |
222 | 222 | return false; |
223 | 223 | } |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | ->thenInvalid('Signing and/or verification key is not readable.') |
228 | 228 | ->end() |
229 | 229 | ->validate() |
230 | - ->ifTrue(function (array $config): bool { |
|
230 | + ->ifTrue(function(array $config): bool { |
|
231 | 231 | return self::SIGNER_SYMMETRIC === $config['type'] && !empty($config['verification_key']); |
232 | 232 | }) |
233 | 233 | ->thenInvalid('Verification key must no be specified for "symmetric" signer.') |
234 | 234 | ->end() |
235 | 235 | ->validate() |
236 | - ->ifTrue(function (array $config): bool { |
|
236 | + ->ifTrue(function(array $config): bool { |
|
237 | 237 | return self::SIGNER_SYMMETRIC === $config['type'] && !empty($config['passphrase']); |
238 | 238 | }) |
239 | 239 | ->thenInvalid('Passphrase must not be specified for "symmetric" signer.') |