File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
reference/forms/types/options Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ better performance::
4646 use App\StaticClass;
4747 use Symfony\Component\Form\AbstractType;
4848 use Symfony\Component\Form\ChoiceList\ChoiceList;
49+ use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
4950 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
5051 use Symfony\Component\OptionsResolver\Options;
5152 use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -61,13 +62,13 @@ better performance::
6162 {
6263 $resolver->setDefaults([
6364 // the example below will create a CallbackChoiceLoader from the callable
64- 'choice_loader' => ChoiceList::lazy($this, function() {
65+ 'choice_loader' => ChoiceList::lazy($this, function () {
6566 return StaticClass::getConstants();
6667 }),
6768
6869 // you can pass your own loader as well, depending on other options
6970 'some_key' => null,
70- 'choice_loader' => function (Options $options): array {
71+ 'choice_loader' => function (Options $options): ChoiceLoaderInterface {
7172 return ChoiceList::loader(
7273 // pass the instance of the type or type extension which is
7374 // currently configuring the choice list as first argument
You can’t perform that action at this time.
0 commit comments