From 496c118c3ac9303666ef0921c50873115d2e9695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 11 Jun 2019 23:42:17 +0200 Subject: [PATCH] Restore compatibility with php 5.5 The ARRAY_FILTER_USE_KEY constant was introduced in php 5.6, let us avoid it for now. See https://www.php.net/manual/en/function.array-filter.php#refsect1-function.array-filter-changelog --- .../PhpUnit/DeprecationErrorHandler/Configuration.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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;