[Form] Catch deprecation errors that are caused by BC code

This commit is contained in:
Colin Frei 2012-12-14 23:16:49 +01:00
parent ebcb432f07
commit b8cdbdc69f
2 changed files with 4 additions and 0 deletions

View File

@ -51,8 +51,10 @@ abstract class AbstractType implements FormTypeInterface
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
$resolver->setDefaults($this->getDefaultOptions(array()));
$resolver->addAllowedValues($this->getAllowedOptionValues(array()));
restore_error_handler();
}
/**

View File

@ -44,8 +44,10 @@ abstract class AbstractTypeExtension implements FormTypeExtensionInterface
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
$resolver->setDefaults($this->getDefaultOptions());
$resolver->addAllowedValues($this->getAllowedOptionValues());
restore_error_handler();
}
/**