| @@ -31,13 +31,22 @@ | ||
| 31 | 31 | |
| 32 | 32 | public function getValueSanitizer(): callable |
| 33 | 33 | { |
| 34 | 34 | return function ($value) { |
| 35 | - if (! is_array($value)) $value = [$value]; | |
| 35 | + if (! is_array($value)) { | |
| 36 | + $value = [$value]; | |
| 37 | + } | |
| 36 | 38 | |
| 37 | - return array_filter($value, function ($item) { | |
| 38 | - return array_key_exists($item, $this->options); | |
| 39 | - }); | |
| 39 | + return array_filter( | |
| 40 | + $value, | |
| 41 | + function ($item) { | |
| 42 | + if (! is_scalar($item)) { | |
| 43 | + return false; | |
| 44 | + } | |
| 45 | + | |
| 46 | + return array_key_exists((string) $item, $this->options); | |
| 47 | + } | |
| 48 | + ); | |
| 40 | 49 | }; |
| 41 | 50 | } |
| 42 | 51 | |
| 43 | 52 | public function render(): void |