Skip to content

Commit

Permalink
[Stopwatch] Deprecate passing null in Section::get() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jschaedl committed Jul 6, 2019
1 parent 6811aaa commit ea48176
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UPGRADE-4.4.md
Expand Up @@ -108,6 +108,11 @@ Security

* Implementations of `PasswordEncoderInterface` and `UserPasswordEncoderInterface` should add a new `needsRehash()` method

Stopwatch
---------

* Deprecated passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead.

TwigBridge
----------

Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/Stopwatch/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.4.0
-----

* Deprecated passing `null` as 1st (`$id`) argument of `Section::get()` method, pass a valid child section identifier instead.

3.4.0
-----

Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Stopwatch/Section.php
Expand Up @@ -62,6 +62,10 @@ public function __construct(float $origin = null, bool $morePrecision = false)
*/
public function get($id)
{
if (null === $id) {
@trigger_error(sprintf('Passing null as 1st ("$id") argument of the "%s()" method is deprecated since Symfony 4.4, pass a valid child section identifier instead.', __METHOD__), E_USER_DEPRECATED);
}

foreach ($this->children as $child) {
if ($id === $child->getId()) {
return $child;
Expand Down

0 comments on commit ea48176

Please sign in to comment.