Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c09eacc

Browse filesBrowse files
committed
minor #15172 [Validator] Add warning about closure not being cachable (Nyholm)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [Validator] Add warning about closure not being cachable Follow up from symfony/symfony#40645 The annotation cache will not work with `Closure`. If I understand correctly, it is not possible to have external dependencies in your custom validator AND get your annotation cached. You have to chose one or the other. Commits ------- ebddb78 [Validator] Add warning about closure not being cachable
2 parents d5c349e + ebddb78 commit c09eacc
Copy full SHA for c09eacc

File tree

1 file changed

+7
-0
lines changed
Filter options

1 file changed

+7
-0
lines changed

‎reference/constraints/Callback.rst

Copy file name to clipboardExpand all lines: reference/constraints/Callback.rst
+7Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.