Skip to content

Commit

Permalink
[Autocomplete] Improve validating extra options in the type extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Dec 27, 2023
1 parent 1d68927 commit 2b6b26c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Autocomplete/src/Form/AutocompleteChoiceTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ private function hasUrlParameters(string $url): bool

private function validateExtraOptions(array $extraOptions): void
{
foreach ($extraOptions as $option) {
foreach ($extraOptions as $optionKey => $option) {
if (!\is_scalar($option) && !\is_array($option) && null !== $option) {
throw new \InvalidArgumentException(sprintf('Extra option "%s" must be a scalar value, an array or null. Got "%s".', $option, get_debug_type($option)));
throw new \InvalidArgumentException(sprintf('Extra option with key "%s" must be a scalar value, an array or null. Got "%s".', $optionKey, get_debug_type($option)));
}

if (\is_array($option)) {
Expand Down

0 comments on commit 2b6b26c

Please sign in to comment.