Skip to content

Commit 63b6901

Browse files
committed
minor #19290 [Form] Fix wrong return type for choice_loader (norkunas)
This PR was merged into the 6.3 branch. Discussion ---------- [Form] Fix wrong return type for choice_loader Commits ------- 4d203f0 [Form] Fix wrong return type for choice_loader
2 parents 9d6745b + 4d203f0 commit 63b6901

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reference/forms/types/options/choice_loader.rst.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)