minor #31143 ChoiceType callable deprecation after/before seems wrong (Simperfit)
This PR was merged into the 3.4 branch.
Discussion
----------
ChoiceType callable deprecation after/before seems wrong
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | none <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | none <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
-->
Was looking at the upgrade file because I'm upgrade an app right now, and just see that mistake I made 3 years ago !!
Commits
-------
11ee84c09e
minor: ChoiceType callable deprecation after/before seems wrong
This commit is contained in:
commit
e4c56f243d
@ -297,19 +297,17 @@ Form
|
||||
`ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed.
|
||||
|
||||
* Using callable strings as choice options in ChoiceType is not supported
|
||||
anymore in favor of passing PropertyPath instances.
|
||||
anymore.
|
||||
|
||||
Before:
|
||||
|
||||
```php
|
||||
'choice_value' => new PropertyPath('range'),
|
||||
'choice_label' => 'strtoupper',
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```php
|
||||
'choice_value' => 'range',
|
||||
'choice_label' => function ($choice) {
|
||||
return strtoupper($choice);
|
||||
},
|
||||
|
Reference in New Issue
Block a user