You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -370,8 +494,8 @@ public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Bui
370
494
$doubleEndpoints = [];
371
495
break;
372
496
}
373
-
if (!\in_array(array_keys(array_merge($endpoints, $doubleEndpoints)), $item['type'])) {
374
-
thrownew \InvalidArgumentException(sprintf('the value should be one of [%s], got %s', implode(', ', array_keys($endpoints)), json_encode($item['type'], \JSON_THROW_ON_ERROR)));
497
+
if (!\in_array($item['type'], array_merge(array_keys($endpoints), $doubleEndpoints))) {
498
+
thrownew \InvalidArgumentException(sprintf('the value should be one of [%s], got %s', implode(', ', array_merge(array_keys($endpoints), $doubleEndpoints)), json_encode($item['type'], \JSON_THROW_ON_ERROR)));
375
499
}
376
500
if (
377
501
\array_key_exists($item['type'], $endpoints)
@@ -380,36 +504,20 @@ public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Bui
380
504
) {
381
505
thrownew \InvalidArgumentException(sprintf('The value should be one of [%s], got %s.', implode(', ', $endpoints[$item['type']]), json_encode($item['method'], \JSON_THROW_ON_ERROR)));
382
506
}
507
+
if (\in_array($item['type'], $doubleEndpoints) && !\array_key_exists('code', $item)) {
508
+
thrownew \InvalidArgumentException(sprintf('The %s type should have a "code" field set.', $item['type']));
509
+
}
383
510
384
511
return$item;
385
512
})
386
513
->end()
387
-
->validate()
388
-
->ifArray()
389
-
->then(function (array$item) {
390
-
if (\in_array($item['type'], self::$doubleEndpoints) && !\array_key_exists('code', $item)) {
391
-
thrownew \InvalidArgumentException(sprintf('The %s type should have a "code" field set.', $item['type']));
@@ -237,7 +269,7 @@ public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Bui
237
269
'shop' => self::$endpointsShop,
238
270
'legacy' => self::$endpointsLegacy
239
271
};
240
-
if (!\in_array(array_keys($endpoints), $item['type'])) {
272
+
if (!\in_array($item['type'], array_keys($endpoints))) {
241
273
thrownew \InvalidArgumentException(sprintf('the value should be one of [%s], got %s', implode(', ', array_keys($endpoints)), json_encode($item['type'], \JSON_THROW_ON_ERROR)));
242
274
}
243
275
if (!\in_array($item['method'], $endpoints[$item['type']])) {
0 commit comments