Skip to content

Commit

Permalink
Fix radios input with booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Tubach committed Jan 30, 2025
1 parent 521da17 commit 29533fb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Form/Control/Callbacks/OptionValueCallbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ public static function value(array $element, $input, FormStateInterface $formSta
return NULL;
}

if (in_array($input, $element['#_option_values'], TRUE)
|| self::isIntegerish($input) && in_array((int) $input, $element['#_option_values'], TRUE)
) {
if (array_key_exists($input, $element['#_option_values'])) {

Check failure on line 67 in src/Form/Control/Callbacks/OptionValueCallbacks.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 7.4 prefer-lowest

Parameter #1 $key of function array_key_exists expects int|string, mixed given.

Check failure on line 67 in src/Form/Control/Callbacks/OptionValueCallbacks.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 8.0 prefer-lowest

Parameter #1 $key of function array_key_exists expects int|string, mixed given.

Check failure on line 67 in src/Form/Control/Callbacks/OptionValueCallbacks.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 8.2 prefer-stable

Parameter #1 $key of function array_key_exists expects int|string, mixed given.
$input = $element['#_option_values'][$input];
}

Expand Down

0 comments on commit 29533fb

Please sign in to comment.