8000 [Validator] Add warning about closure not being cachable · symfony/symfony-docs@ebddb78 · GitHub
[go: up one dir, main page]

Skip to content

Commit ebddb78

Browse files
Nyholmjaviereguiluz
authored andcommitted
[Validator] Add warning about closure not being cachable
1 parent 0437248 commit ebddb78

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

reference/constraints/Callback.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ constructor of the Callback constraint::
251251
}
252252
}
253253

254+
.. warning::
255+
256+
Using a ``Closure`` together with annotation configuration will disable the
257+
annotation cache for that class/property/methods because ``Closure``s cannot
258+
be cached. For best performance, it is recommended to use a static callback
259+
method.
260+
254261
Options
255262
-------
256263

0 commit comments

Comments
 (0)
0