8000 Merge branch '6.3' into 6.4 · symfony/symfony-docs@28e3062 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28e3062

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: [Form] Fix wrong return type for choice_loader
2 parents 60bd0ee + 63b6901 commit 28e3062

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)
0