[Stopwatch] Deprecate passing null in Section::get() method.

This commit is contained in:
Jan Schädlich 2019-07-06 16:12:52 +02:00
parent 6811aaa8e0
commit ea4817677b
3 changed files with 14 additions and 0 deletions

View File

@ -108,6 +108,11 @@ Security
* Implementations of `PasswordEncoderInterface` and `UserPasswordEncoderInterface` should add a new `needsRehash()` method * 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 TwigBridge
---------- ----------

View File

@ -1,6 +1,11 @@
CHANGELOG 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 3.4.0
----- -----

View File

@ -62,6 +62,10 @@ class Section
*/ */
public function get($id) 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) { foreach ($this->children as $child) {
if ($id === $child->getId()) { if ($id === $child->getId()) {
return $child; return $child;