diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php index 44f0341205..6b42814bbc 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php @@ -90,9 +90,12 @@ class Configuration */ public function tolerates(array $deprecations) { - $deprecationCounts = array_filter($deprecations, function ($key) { - return false !== strpos($key, 'Count') && false === strpos($key, 'legacy'); - }, ARRAY_FILTER_USE_KEY); + $deprecationCounts = []; + foreach ($deprecations as $key => $deprecation) { + if (false !== strpos($key, 'Count') && false === strpos($key, 'legacy')) { + $deprecationCounts[$key] = $deprecation; + } + } if (array_sum($deprecationCounts) > $this->thresholds['total']) { return false;