X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fzendframework%2Fzend-stdlib%2Fsrc%2FArrayUtils.php;fp=vendor%2Fzendframework%2Fzend-stdlib%2Fsrc%2FArrayUtils.php;h=4edcacf11917dba0145cc3e61f153e06e919f8ca;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0e2b738ccbf3f7efda608fa317755c666729363f;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/zendframework/zend-stdlib/src/ArrayUtils.php b/vendor/zendframework/zend-stdlib/src/ArrayUtils.php index 0e2b738cc..4edcacf11 100644 --- a/vendor/zendframework/zend-stdlib/src/ArrayUtils.php +++ b/vendor/zendframework/zend-stdlib/src/ArrayUtils.php @@ -292,12 +292,13 @@ abstract class ArrayUtils } /** - * Compatibility Method for array_filter on <5.6 systems + * @deprecated Since 3.2.0; use the native array_filter methods * * @param array $data * @param callable $callback * @param null|int $flag * @return array + * @throws Exception\InvalidArgumentException */ public static function filter(array $data, $callback, $flag = null) { @@ -308,28 +309,6 @@ abstract class ArrayUtils )); } - if (version_compare(PHP_VERSION, '5.6.0') >= 0) { - return array_filter($data, $callback, $flag); - } - - $output = []; - foreach ($data as $key => $value) { - $params = [$value]; - - if ($flag === static::ARRAY_FILTER_USE_BOTH) { - $params[] = $key; - } - - if ($flag === static::ARRAY_FILTER_USE_KEY) { - $params = [$key]; - } - - $response = call_user_func_array($callback, $params); - if ($response) { - $output[$key] = $value; - } - } - - return $output; + return array_filter($data, $callback, $flag); } }