@@ -39,6 +39,7 @@ that constructor with no arguments::
3939
4040 use Symfony\Component\Form\AbstractType;
4141 use Acme\DemoBundle\Entity\Blog;
42+ use Symfony\Component\OptionsResolver\OptionsResolverInterface;
4243
4344 class BlogType extends AbstractType
4445 {
@@ -50,11 +51,11 @@ that constructor with no arguments::
5051 }
5152 // ...
5253
53- public functiongetDefaultOptions( )
54+ public functionsetDefaultOptions(OptionsResolverInterface $resolver )
5455 {
55- return array(
56+ $resolver->setDefaults( array(
5657 'empty_data' => new Blog($this->someDependency),
57- );
58+ )) ;
5859 }
5960 }
6061
@@ -71,14 +72,15 @@ if it is needed.
7172
7273The closure must accept a ``FormInterface `` instance as the first argument::
7374
75+ use Symfony\Component\OptionsResolver\OptionsResolverInterface;
7476 use Symfony\Component\Form\FormInterface;
7577 // ...
7678
77- public functiongetDefaultOptions( )
79+ public functionsetDefaultOptions(OptionsResolverInterface $resolver )
7880 {
79- return array(
81+ $resolver->setDefaults( array(
8082 'empty_data' => function (FormInterface $form) {
8183 return new Blog($form->get('title')->getData());
8284 },
83- );
85+ )) ;
8486 }