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
@@ -143,12 +352,33 @@ public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Bui
143
352
->validate()
144
353
->ifArray()
145
354
->then(function (array$item) {
355
+
switch($item['api_type']) {
356
+
case'admin':
357
+
$endpoints = self::$endpointsAdmin;
358
+
$doubleEndpoints = self::$doubleEndpointsAdmin;
359
+
break;
360
+
case'shop':
361
+
$endpoints = self::$endpointsShop;
362
+
$doubleEndpoints = self::$doubleEndpointsShop;
363
+
break;
364
+
case'legacy':
365
+
$endpoints = self::$endpointsLegacy;
366
+
$doubleEndpoints = self::$doubleEndpointsLegacy;
367
+
break;
368
+
default:
369
+
$endpoints = [];
370
+
$doubleEndpoints = [];
371
+
break;
372
+
}
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)));
thrownew \InvalidArgumentException(sprintf('The value should be one of [%s], got %s.', implode(', ', self::$endpoints[$item['type']]), json_encode($item['method'], \JSON_THROW_ON_ERROR)));
381
+
thrownew \InvalidArgumentException(sprintf('The value should be one of [%s], got %s.', implode(', ', $endpoints[$item['type']]), json_encode($item['method'], \JSON_THROW_ON_ERROR)));
0 commit comments