@@ -72,21 +72,21 @@ method::
72
72
// a callback to return the label for a given choice
73
73
// if a placeholder is used, its empty value (null) may be passed but
74
74
// its label is defined by its own "placeholder" option
75
- 'choice_label' => function(?Category $category) {
75
+ 'choice_label' => function (?Category $category) {
76
76
return $category ? strtoupper($category->getName()) : '';
77
77
},
78
78
// returns the html attributes for each option input (may be radio/checkbox)
79
- 'choice_attr' => function(?Category $category) {
79
+ 'choice_attr' => function (?Category $category) {
80
80
return $category ? ['class' => 'category_'.strtolower($category->getName())] : [];
81
81
},
82
82
// every option can use a string property path or any callable that get
83
83
// passed each choice as argument, but it may not be needed
84
- 'group_by' => function() {
84
+ 'group_by' => function () {
85
85
// randomly assign things into 2 groups
86
86
return rand(0, 1) == 1 ? 'Group A' : 'Group B';
87
87
},
88
88
// a callback to return whether a category is preferred
89
- 'preferred_choices' => function(?Category $category) {
89
+ 'preferred_choices' => function (?Category $category) {
90
90
return $category && 100 < $category->getArticleCounts();
91
91
},
92
92
]);
@@ -190,7 +190,7 @@ if you want to take advantage of lazy loading::
190
190
// ...
191
191
192
192
$builder->add('constants', ChoiceType::class, [
193
- 'choice_loader' => new CallbackChoiceLoader(function() {
193
+ 'choice_loader' => new CallbackChoiceLoader(function () {
194
194
return StaticClass::getConstants();
195
195
}),
196
196
]);
0 commit comments