From ebddb78293a7901799d6aeba24d80f42301c13fa Mon Sep 17 00:00:00 2001 From: Nyholm Date: Wed, 31 Mar 2021 09:24:36 +0200 Subject: [PATCH] [Validator] Add warning about closure not being cachable --- reference/constraints/Callback.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst index 6985f3953e1..65a63235a73 100644 --- a/reference/constraints/Callback.rst +++ b/reference/constraints/Callback.rst @@ -251,6 +251,13 @@ constructor of the Callback constraint:: } } +.. warning:: + + Using a ``Closure`` together with annotation configuration will disable the + annotation cache for that class/property/methods because ``Closure``s cannot + be cached. For best performance, it is recommended to use a static callback + method. + Options -------