|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\Form\Extension\Core\ChoiceList;
|
13 | 13 |
|
14 |
| -@trigger_error('The '.__NAMESPACE__.'\SimpleChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED); |
15 |
| - |
16 | 14 | /**
|
17 | 15 | * A choice list for choices of type string or integer.
|
18 | 16 | *
|
|
30 | 28 | * </code>
|
31 | 29 | *
|
32 | 30 | * @author Bernhard Schussek <[email protected]>
|
33 |
| - * |
34 |
| - * @deprecated since version 2.7, to be removed in 3.0. |
35 |
| - * Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead. |
36 | 31 | */
|
37 | 32 | class SimpleChoiceList extends ChoiceList
|
38 | 33 | {
|
39 | 34 | /**
|
40 | 35 | * Creates a new simple choice list.
|
41 | 36 | *
|
42 |
| - * @param array $choices The array of choices with the choices as keys and |
43 |
| - * the labels as values. Choices may also be given |
44 |
| - * as hierarchy of unlimited depth by creating nested |
45 |
| - * arrays. The title of the sub-hierarchy is stored |
46 |
| - * in the array key pointing to the nested array. |
| 37 | + * @param array|\Traversable $choices The array of choices with the choices as keys and |
| 38 | + * the labels as values. Choices may also be given |
| 39 | + * as hierarchy of unlimited depth by creating nested |
| 40 | + * arrays. The title of the sub-hierarchy is stored |
| 41 | + * in the array key pointing to the nested array. |
47 | 42 | * @param array $preferredChoices A flat array of choices that should be
|
48 |
| - * presented to the user with priority. |
| 43 | + * presented to the user with priority. |
49 | 44 | */
|
50 |
| - public function __construct(array $choices, array $preferredChoices = array()) |
| 45 | + public function __construct($choices, array $preferredChoices = array()) |
51 | 46 | {
|
52 | 47 | // Flip preferred choices to speed up lookup
|
53 | 48 | parent::__construct($choices, $choices, array_flip($preferredChoices));
|
@@ -91,7 +86,7 @@ public function getValuesForChoices(array $choices)
|
91 | 86 | * @param array $labels Ignored.
|
92 | 87 | * @param array $preferredChoices The preferred choices.
|
93 | 88 | */
|
94 |
| - protected function addChoices(array &$bucketForPreferred, array &$bucketForRemaining, $choices, array $labels, array $preferredChoices) |
| 89 | + protected function addChoices(array &$bucketForPreferred, array &$bucketForRemaining, $choices, $labels, $preferredChoices) |
95 | 90 | {
|
96 | 91 | // Add choices to the nested buckets
|
97 | 92 | foreach ($choices as $choice => $label) {
|
|
0 commit comments