Skip to content

Commit

Permalink
minor #31143 ChoiceType callable deprecation after/before seems wrong…
Browse files Browse the repository at this point in the history
… (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
-------

11ee84c minor: ChoiceType callable deprecation after/before seems wrong
  • Loading branch information
fabpot committed Jun 5, 2019
2 parents 11f04ab + 11ee84c commit e4c56f2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down

0 comments on commit e4c56f2

Please sign in to comment.