src/Extension/Core/Type/BooleanType.php
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'true_value' => 'true',
            'false_value' => 'false',
            'value_format' => function (Options $options) {
                $trueValue = $options['true_value'];
                $falseValue = $options['false_value'];

                // Return a closure for later execution (the actual formatter)
                return function ($value) use ($trueValue, $falseValue) {
                    $value = (array) $value;

                    $boolValue = true;
                    foreach ($value as $val) {
                        $boolValue = (bool) ($boolValue & (bool) $val);
                        if (!$boolValue) {
                            break;
                        }
                    }

                    return $boolValue ? $trueValue : $falseValue;
                };
            },
        ]);
    }
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'true_value' => 'true',
            'false_value' => 'false',
            'value_format' => function (Options $options) {
                $trueValue = $options['true_value'];
                $falseValue = $options['false_value'];

                // Return a closure for later execution (the actual formatter)
                return function ($value) use ($trueValue, $falseValue) {
                    $value = (array) $value;

                    $boolValue = true;
                    foreach ($value as $val) {
                        $boolValue = (bool) ($boolValue & (bool) $val);
                        if (!$boolValue) {
                            break;
                        }
                    }

                    return $boolValue ? $trueValue : $falseValue;
                };
            },
        ]);
    }
{@inheritdoc}