Skip to content

Commit 0910bb9

Browse files
committed
Merge branch '5.0' into 5.1
* 5.0: Add compatible type-hinting Add documentation about data collectors late collect
2 parents 7787bad + e86c2c9 commit 0910bb9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

profiler/data_collector.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ request::
7979
:doc:`/testing/profiling`) so it's recommended to return a string which is
8080
short, lowercase and without white spaces.
8181

82+
The ``collect()`` method is called during the :ref:`kernel.response <component-http-kernel-kernel-response>`
83+
event. If you need to collect data that is only available later, implement
84+
:class:`Symfony\\Component\\HttpKernel\\DataCollector\\LateDataCollectorInterface`
85+
and define the ``lateCollect()`` method, which is invoked just before the profiler
86+
data serialization (during :ref:`kernel.terminate <component-http-kernel-kernel-terminate>` event).
87+
8288
.. _data_collector_tag:
8389

8490
Enabling Custom Data Collectors

serializer/custom_normalizer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:
3535
$this->normalizer = $normalizer;
3636
}
3737

38-
public function normalize($topic, $format = null, array $context = [])
38+
public function normalize($topic, string $format = null, array $context = [])
3939
{
4040
$data = $this->normalizer->normalize($topic, $format, $context);
4141

@@ -47,7 +47,7 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:
4747
return $data;
4848
}
4949

50-
public function supportsNormalization($data, $format = null, array $context = [])
50+
public function supportsNormalization($data, string $format = null, array $context = [])
5151
{
5252
return $data instanceof Topic;
5353
}

0 commit comments

Comments
 (0)