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
thrownewInvalidOptionsException(sprintf('The option "http" has unknown keys: %s.', implode(', ', $unknownKeys)));
155
-
}
156
-
157
-
foreach ($allowedKeysas$key) {
158
-
if (!array_key_exists($key, $value)) {
159
-
thrownewInvalidOptionsException(sprintf('The option "http" must define the key "%s".', $key));
160
-
}
161
-
}
162
-
163
-
if ($value['client'] !== null && !$value['client'] instanceof ClientInterface) {
164
-
thrownewInvalidOptionsException(sprintf('The option "http[client]" is expected to be an instance of %s or null, but got %s.', ClientInterface::class, self::debugType($value['client'])));
165
-
}
166
-
if ($value['request_factory'] !== null && !$value['request_factory'] instanceof RequestFactoryInterface) {
167
-
thrownewInvalidOptionsException(sprintf('The option "http[request_factory]" is expected to be an instance of %s or null, but got %s.', RequestFactoryInterface::class, self::debugType($value['request_factory'])));
168
-
}
169
-
if ($value['response_factory'] !== null && !$value['response_factory'] instanceof ResponseFactoryInterface) {
170
-
thrownewInvalidOptionsException(sprintf('The option "http[response_factory]" is expected to be an instance of %s or null, but got %s.', ResponseFactoryInterface::class, self::debugType($value['response_factory'])));
171
-
}
172
-
if ($value['stream_factory'] !== null && !$value['stream_factory'] instanceof StreamFactoryInterface) {
173
-
thrownewInvalidOptionsException(sprintf('The option "http[stream_factory]" is expected to be an instance of %s or null, but got %s.', StreamFactoryInterface::class, self::debugType($value['stream_factory'])));
174
-
}
175
-
if ($value['uri_factory'] !== null && !$value['uri_factory'] instanceof UriFactoryInterface) {
176
-
thrownewInvalidOptionsException(sprintf('The option "http[uri_factory]" is expected to be an instance of %s or null, but got %s.', UriFactoryInterface::class, self::debugType($value['uri_factory'])));
177
-
}
178
-
179
-
return$value;
180
-
});
181
-
182
-
$resolver->setNormalizer('hydration', function (Options$options, $value) {
183
-
if (!is_array($value)) {
184
-
thrownewInvalidOptionsException(sprintf('The option "hydration" is expected to be of type "array", but is of type "%s".', self::debugType($value)));
thrownewInvalidOptionsException(sprintf('The option "hydration" has unknown keys: %s.', implode(', ', $unknownKeys)));
191
-
}
192
-
193
-
if (!array_key_exists('event_listener_handles_hydration', $value) || !is_bool($value['event_listener_handles_hydration'])) {
194
-
thrownewInvalidOptionsException('The option "hydration[event_listener_handles_hydration]" is expected to be of type "bool".');
195
-
}
196
-
if (!array_key_exists('only_for_specified_models', $value) || !is_array($value['only_for_specified_models'])) {
197
-
thrownewInvalidOptionsException('The option "hydration[only_for_specified_models]" is expected to be of type "array".');
198
-
}
199
-
200
-
return$value;
201
-
});
202
-
203
-
$resolver->setNormalizer('event_dispatcher', function (Options$options, $value) {
204
-
if (!is_array($value)) {
205
-
thrownewInvalidOptionsException(sprintf('The option "event_dispatcher" is expected to be of type "array", but is of type "%s".', self::debugType($value)));
thrownewInvalidOptionsException(sprintf('The option "event_dispatcher" has unknown keys: %s.', implode(', ', $unknownKeys)));
212
-
}
213
-
214
-
if (!array_key_exists('adapter', $value) || !$value['adapter'] instanceof EventDispatcherInterface) {
215
-
thrownewInvalidOptionsException(sprintf('The option "event_dispatcher[adapter]" is expected to be an instance of %s.', EventDispatcherInterface::class));
0 commit comments