From d207dd68e5976614ba1f4771953b535871624515 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 3 Jun 2024 02:03:15 +0100 Subject: [PATCH] https://github.com/mage2pro/core/issues/403 --- Core/lib/array/map.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Core/lib/array/map.php b/Core/lib/array/map.php index 7cc7dcf6f..5280fb356 100644 --- a/Core/lib/array/map.php +++ b/Core/lib/array/map.php @@ -147,7 +147,13 @@ function df_map($a1, $a2, $pAppend = [], $pPrepend = [], int $keyPosition = 0, b /** * 2016-08-09 Функция принимает аргументы в любом порядке. - * @used-by df_category_dp_meta() + * 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_kv() * @used-by df_kv_table() * @used-by df_modules_my() @@ -162,8 +168,8 @@ function df_map($a1, $a2, $pAppend = [], $pPrepend = [], int $keyPosition = 0, b * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l3/tabs/overview.phtml (https://github.com/cabinetsbay/catalog/issues/22) * @used-by vendor/mage2pro/color/view/frontend/templates/index.phtml - * @param array|callable|Traversable $a1 - * @param array|callable|Traversable $a2 + * @param callable|iterable $a1 + * @param callable|iterable $a2 * @return array(int|string => mixed) */ function df_map_k($a1, $a2):array {return df_map($a1, $a2, [], [], DF_BEFORE);}