diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index a2790af5c0d..dc6fa188a28 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -92,19 +92,18 @@ method:: new Category('Cat3'), new Category('Cat4'), ], - 'choice_label' => function($category, $key, $index) { + 'choice_label' => function($category, $index, $key) { /** @var Category $category */ return strtoupper($category->getName()); }, - 'choice_attr' => function($category, $key, $index) { + 'choice_attr' => function($category, $index, $key) { return ['class' => 'category_'.strtolower($category->getName())]; }, - - 'group_by' => function($category, $key, $index) { + 'group_by' => function($category, $index, $key) { // randomly assign things into 2 groups return rand(0, 1) == 1 ? 'Group A' : 'Group B'; }, - 'preferred_choices' => function($category, $key, $index) { + 'preferred_choices' => function($category, $index, $key) { return $category->getName() == 'Cat2' || $category->getName() == 'Cat3'; }, ]); diff --git a/reference/forms/types/options/choice_attr.rst.inc b/reference/forms/types/options/choice_attr.rst.inc index 9b74a6b13e7..a70e67e6d9a 100644 --- a/reference/forms/types/options/choice_attr.rst.inc +++ b/reference/forms/types/options/choice_attr.rst.inc @@ -18,7 +18,7 @@ If an array, the keys of the ``choices`` array must be used as keys:: 'No' => false, 'Maybe' => null, ), - 'choice_attr' => function($val, $key, $index) { + 'choice_attr' => function($val, $index, $key) { // adds a class like attending_yes, attending_no, etc return ['class' => 'attending_'.strtolower($key)]; }, diff --git a/reference/forms/types/options/choice_label.rst.inc b/reference/forms/types/options/choice_label.rst.inc index 0dbf1f1e89d..c09710f45d2 100644 --- a/reference/forms/types/options/choice_label.rst.inc +++ b/reference/forms/types/options/choice_label.rst.inc @@ -16,7 +16,7 @@ more control:: 'no' => false, 'maybe' => null, ), - 'choice_label' => function ($value, $key, $index) { + 'choice_label' => function ($value, $index, $key) { if ($value == true) { return 'Definitely!'; } diff --git a/reference/forms/types/options/group_by.rst.inc b/reference/forms/types/options/group_by.rst.inc index 31ded648baa..be62a8d5084 100644 --- a/reference/forms/types/options/group_by.rst.inc +++ b/reference/forms/types/options/group_by.rst.inc @@ -22,7 +22,7 @@ Take the following example:: '1 week' => new \DateTime('+1 week'), '1 month' => new \DateTime('+1 month') ), - 'group_by' => function($val, $key, $index) { + 'group_by' => function($val, $index, $key) { if ($val <= new \DateTime('+3 days')) { return 'Soon'; } else {