From cef10685daf5bcad8d5adfe742cc8ee3ec8c94f2 Mon Sep 17 00:00:00 2001 From: Patrick McDougle Date: Sat, 17 Sep 2016 13:19:18 -0700 Subject: [PATCH 1/2] Callback doesn't have to be static --- reference/constraints/Choice.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index a851af61a74..e05a88691d4 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -143,6 +143,9 @@ form element. } } +.. versionadded:: 3.2 + As of 3.2 the callback no longer needs to be static. + You can pass the name of this method to the `callback`_ option of the ``Choice`` constraint. @@ -208,7 +211,7 @@ constraint. } } -If the static callback is stored in a different class, for example ``Util``, +If the callback is stored in a different class and is static, for example ``Util``, you can pass the class name and the method as an array. .. configuration-block:: From 90fa7324111597e1678d6489150666305da1e33c Mon Sep 17 00:00:00 2001 From: Patrick McDougle Date: Sun, 18 Sep 2016 18:16:40 -0700 Subject: [PATCH 2/2] PR feedback --- reference/constraints/Choice.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index e05a88691d4..46a5c5ca237 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -144,7 +144,7 @@ form element. } .. versionadded:: 3.2 - As of 3.2 the callback no longer needs to be static. + As of Symfony 3.2 the callback no longer needs to be static. You can pass the name of this method to the `callback`_ option of the ``Choice`` constraint.