Skip to content

Commit dc6eee8

Browse files
committed
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
1 parent 6d9df86 commit dc6eee8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

DeprecationErrorHandler/Configuration.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ public function isEnabled()
9090
*/
9191
public function tolerates(array $deprecations)
9292
{
93-
$deprecationCounts = array_filter($deprecations, function ($key) {
94-
return false !== strpos($key, 'Count') && false === strpos($key, 'legacy');
95-
}, ARRAY_FILTER_USE_KEY);
93+
$deprecationCounts = [];
94+
foreach ($deprecations as $key => $deprecation) {
95+
if (false !== strpos($key, 'Count') && false === strpos($key, 'legacy')) {
96+
$deprecationCounts[$key] = $deprecation;
97+
}
98+
}
9699

97100
if (array_sum($deprecationCounts) > $this->thresholds['total']) {
98101
return false;

0 commit comments

Comments
 (0)