From 6b76553a050229970046068f431ff9108051208f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 3 Jun 2024 01:37:43 +0100 Subject: [PATCH] https://github.com/mage2pro/core/issues/403 --- Core/lib/array/clean/filter.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Core/lib/array/clean/filter.php b/Core/lib/array/clean/filter.php index b49aed082..6aeb42408 100644 --- a/Core/lib/array/clean/filter.php +++ b/Core/lib/array/clean/filter.php @@ -69,9 +69,16 @@ function df_filter_f($a1, $a2, callable $fA):array {/** @var array $r */ /** * 2023-07-26 "Implement `df_filter_head()`": https://github.com/mage2pro/core/issues/264 + * 2024-06-03 + * 1.1) "Use the `iterable` type": https://github.com/mage2pro/core/issues/403 + * 1.2) `iterable` is supported by PHP ≥ 7.1: https://3v4l.org/qNX1j + * 1.3) https://php.net/manual/en/language.types.iterable.php + * 2) We still can not use «Union Types» (e.g. `callable|iterable`) because they require PHP ≥ 8 (we need to support PHP ≥ 7.1): + * 2.1) https://php.watch/versions/8.0/union-types + * 2.2) https://3v4l.org/AOWmO * @used-by df_bt_filter_head() - * @param callable|array(int|string => mixed)|array[]Traversable $a1 - * @param callable|array(int|string => mixed)|array[]|Traversable $a2 + * @param callable|iterable $a1 + * @param callable|iterable $a2 * @return array(int|string => mixed) */ function df_filter_head($a1, $a2):array {return df_filter_f($a1, $a2, function(array $a, $f):array {