I am working on a project based on Symfony 2.7.
I have added the following function a custom form type:
public function setDefaultOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'error_bubbling' => true
]
);
}
... and when loading the form, I now get the following FatalErrorException:
Compile Error: Declaration of MyCompany\AppBundle\Form\ContactType::setDefaultOptions() must be compatible with Symfony\Component\Form\FormTypeInterface::setDefaultOptions(Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver)
Glancing at FormTypeInterface::setDefaultOptions()
, it appears that I am complying with the method signature. What am I doing wrong?
OptionsResolverInterface
is not the same asOptionsResolver
– u_mulder