The "data_class" option now must be set if a form maps to an object. If
you leave it empty, the form will expect an array, an instance of \ArrayAccess
or a scalar value and fail with a corresponding exception.
Likewise, if a form maps to an array or an instance of \ArrayAccess, the option
must be left null now.
Form mapped to an instance of Person:
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Acme\Demo\Person',
));
}
The "data_class" option now must be set if a form maps to an object. If you leave it empty, the form will expect an array, an instance of \ArrayAccess or a scalar value and fail with a corresponding exception.
Likewise, if a form maps to an array or an instance of \ArrayAccess, the option must be left null now.
Form mapped to an instance of
Person
: