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:
Grégoire Paris 2019-06-11 23:42:17 +02:00
parent ac1a660130
commit 496c118c3a
No known key found for this signature in database
GPG Key ID: 24D48B8012B116BF

View File

@ -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;