diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php b/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php index 2605634b2bee..2741a9afd417 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php @@ -33,7 +33,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) // doing so also calls setDataLocked(true). $builder->setData(isset($options['data']) ? $options['data'] : false); $builder->addViewTransformer(new BooleanToStringTransformer($options['value'], $options['false_values'])); - $builder->setAttribute('_false_is_empty', true); // @internal - A boolean flag to treat false as empty, see Form::isEmpty() - Do not rely on it, it will be removed in Symfony 5.1. } /** diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index adc46ac4fefb..cead4fbd6b27 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -740,9 +740,7 @@ public function isEmpty() // arrays, countables ((\is_array($this->modelData) || $this->modelData instanceof \Countable) && 0 === \count($this->modelData)) || // traversables that are not countable - ($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData)) || - // @internal - Do not rely on it, it will be removed in Symfony 5.1. - (false === $this->modelData && $this->config->getAttribute('_false_is_empty')); + ($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData)); } /**