diff --git a/reference/forms/types/options/choice_loader.rst.inc b/reference/forms/types/options/choice_loader.rst.inc index 502ddb125c7..95f670ec0fc 100644 --- a/reference/forms/types/options/choice_loader.rst.inc +++ b/reference/forms/types/options/choice_loader.rst.inc @@ -46,6 +46,7 @@ better performance:: use App\StaticClass; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\ChoiceList\ChoiceList; + use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -61,13 +62,13 @@ better performance:: { $resolver->setDefaults([ // the example below will create a CallbackChoiceLoader from the callable - 'choice_loader' => ChoiceList::lazy($this, function() { + 'choice_loader' => ChoiceList::lazy($this, function () { return StaticClass::getConstants(); }), // you can pass your own loader as well, depending on other options 'some_key' => null, - 'choice_loader' => function (Options $options): array { + 'choice_loader' => function (Options $options): ChoiceLoaderInterface { return ChoiceList::loader( // pass the instance of the type or type extension which is // currently configuring the choice list as first argument