minor: ChoiceType callable deprecation after/before seems wrong

That is on me 3 years ago !
This commit is contained in:
Hamza Amrouche 2019-04-17 16:07:28 +02:00 committed by Amrouche Hamza
parent a288a74d74
commit 11ee84c09e
No known key found for this signature in database
GPG Key ID: E45A3DA456145BC1
1 changed files with 1 additions and 3 deletions

View File

@ -297,19 +297,17 @@ Form
`ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed. `ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed.
* Using callable strings as choice options in ChoiceType is not supported * Using callable strings as choice options in ChoiceType is not supported
anymore in favor of passing PropertyPath instances. anymore.
Before: Before:
```php ```php
'choice_value' => new PropertyPath('range'),
'choice_label' => 'strtoupper', 'choice_label' => 'strtoupper',
``` ```
After: After:
```php ```php
'choice_value' => 'range',
'choice_label' => function ($choice) { 'choice_label' => function ($choice) {
return strtoupper($choice); return strtoupper($choice);
}, },