File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3030:method: `Symfony\\ Component\\ HttpKernel\\ DataCollector\\ DataCollectorInterface::collect `
3131method is responsible for storing the collected data in local properties.
3232
33+ .. caution ::
34+
35+ The :method: `Symfony\\ Component\\ HttpKernel\\ DataCollector\\ DataCollectorInterface::collect ` method is only called once.
36+ It is not used to "gather" data but is there to "pick up" the data that has been stored by your service.
37+
3338Most of the time, it is convenient to extend
3439:class: `Symfony\\ Component\\ HttpKernel\\ DataCollector\\ DataCollector ` and
3540populate the ``$this->data `` property (it takes care of serializing the
@@ -71,6 +76,11 @@ collects the method and accepted content types from the request::
7176
7277The getters are added to give the template access to the collected information.
7378
79+ .. caution ::
80+
81+ If the data that is not directly related to the request or response, you need to make the data accessible to your DataCollector.
82+ This can be achieved by injecting the service that holds the information you intend to profile into your DataCollector.
83+
7484.. caution ::
7585
7686 As the profiler serializes data collector instances, you should not
You can’t perform that action at this time.
0 commit comments