Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Commit fe1c922

Browse files
committed
Remove a PHP feature that requires PHP 5.6+
1 parent 913002c commit fe1c922

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/EasyLogFormatter.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,15 @@ private function filterVariablesUsedAsPlaceholders($string, array $variables)
489489
return $variables;
490490
}
491491

492-
return array_filter($variables, function ($key) use ($string) {
493-
return false === strpos($string, '{'.$key.'}');
494-
}, ARRAY_FILTER_USE_KEY);
492+
// array_filter() is not used because ARRAY_FILTER_USE_KEY requires PHP 5.6
493+
$filteredVariables = array();
494+
foreach ($variables as $key => $value) {
495+
if (false === strpos($string, '{'.$key.'}')) {
496+
$filteredVariables[$key] = $value;
497+
}
498+
}
499+
500+
return $filteredVariables;
495501
}
496502

497503
/**

0 commit comments

Comments
 (0)