8000 fixes validation when passing array to enum options · laravel-enso/forms@8ff25ac · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ff25ac

Browse files
committed
fixes validation when passing array to enum options
1 parent 4e26bff commit 8ff25ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Services/Validators/Meta.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ private function selectMetaParameterMissing(): bool
102102
private function invalidOptions($options): bool
103103
{
104104
return $options
105+
&& ! is_array($options)
105106
&& (
106107
enum_exists($options) && ! (new ReflectionEnum($options))
107-
->implementsInterface(Select::class)
108-
|| ! class_exists($options) && ! is_array($options) && ! method_exists($options, 'toArray')
108+
->implementsInterface(Select::class)
109+
|| ! class_exists($options) && ! method_exists($options, 'toArray')
109110
);
110111
}
111112
}

0 commit comments

Comments
 (0)
0