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
@@ -119,9 +120,6 @@ public function __construct(private readonly ExpressionLanguage $interpreter) {}
119
120
120
121
publicfunctionapplies(array$config): bool
121
122
{
122
-
if (!isset($config['api_type'])) {
123
-
returnfalse;
124
-
}
125
123
switch ($config['api_type']) {
126
124
case'admin':
127
125
$endpoints = self::$endpointsAdmin;
@@ -136,9 +134,7 @@ public function applies(array $config): bool
136
134
$doubleEndpoints = self::$doubleEndpointsLegacy;
137
135
break;
138
136
default:
139
-
$endpoints = [];
140
-
$doubleEndpoints = [];
141
-
break;
137
+
thrownew \InvalidArgumentException(sprintf('The value of api_type should be one of [%s], got %s.', implode(', ', ApiType::casesValue()), json_encode($config['api_type'], \JSON_THROW_ON_ERROR)));
default => thrownew \InvalidArgumentException(sprintf('The value of api_type should be one of [%s], got %s.', implode(', ', ApiType::casesValue()), json_encode($config['api_type'], \JSON_THROW_ON_ERROR)))
@@ -118,9 +119,6 @@ public function __construct(private readonly ExpressionLanguage $interpreter) {}
118
119
119
120
publicfunctionapplies(array$config): bool
120
121
{
121
-
if (!isset($config['api_type'])) {
122
-
returnfalse;
123
-
}
124
122
switch ($config['api_type']) {
125
123
case'admin':
126
124
$endpoints = self::$endpointsAdmin;
@@ -135,9 +133,7 @@ public function applies(array $config): bool
135
133
$doubleEndpoints = self::$doubleEndpointsLegacy;
136
134
break;
137
135
default:
138
-
$endpoints = [];
139
-
$doubleEndpoints = [];
140
-
break;
136
+
thrownew \InvalidArgumentException(sprintf('The value of api_type should be one of [%s], got %s.', implode(', ', ApiType::casesValue()), json_encode($config['api_type'], \JSON_THROW_ON_ERROR)));
default => thrownew \InvalidArgumentException(sprintf('The value of api_type should be one of [%s], got %s.', implode(', ', ApiType::casesValue()), json_encode($config['api_type'], \JSON_THROW_ON_ERROR)))
0 commit comments