diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index fe6397d0dd3bf..ede722812290b 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -456,6 +456,11 @@ Serializer * The `AbstractNormalizer::handleCircularReference()` method has two new `$format` and `$context` arguments. * Removed support for instantiating a `DataUriNormalizer` with a default MIME type guesser when the `symfony/mime` component isn't installed. +Stopwatch +--------- + + * Removed support of passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead. + Translation ----------- diff --git a/src/Symfony/Component/Stopwatch/Section.php b/src/Symfony/Component/Stopwatch/Section.php index 5d21782f72ea0..4c1a83f4b9c16 100644 --- a/src/Symfony/Component/Stopwatch/Section.php +++ b/src/Symfony/Component/Stopwatch/Section.php @@ -58,7 +58,7 @@ public function __construct(float $origin = null, bool $morePrecision = false) * * @return self|null The child section or null when none found */ - public function get(?string $id) + public function get(string $id) { if (null === $id) { @trigger_error(sprintf('Passing "null" as the first argument of the "%s()" method is deprecated since Symfony 4.4, pass a valid child section identifier instead.', __METHOD__), E_USER_DEPRECATED); @@ -80,7 +80,7 @@ public function get(?string $id) */ public function open(?string $id) { - if (null === $session = $this->get($id)) { + if (null === $id || null === $session = $this->get($id)) { $session = $this->children[] = new self(microtime(true) * 1000, $this->morePrecision); }