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
This commit is contained in:
parent
ac1a660130
commit
496c118c3a
@ -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;
|
||||
|
Reference in New Issue
Block a user