From b92240c9866512ccaa37429d36460da1fe549b00 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 3 Jun 2024 01:44:10 +0100 Subject: [PATCH] https://github.com/mage2pro/core/issues/403 --- app/code/local/Df/Core/lib/array/other.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/local/Df/Core/lib/array/other.php b/app/code/local/Df/Core/lib/array/other.php index 266a16018c..80b3c97747 100644 --- a/app/code/local/Df/Core/lib/array/other.php +++ b/app/code/local/Df/Core/lib/array/other.php @@ -47,11 +47,16 @@ function dfa_group(array $a, $k = null):array { /** * 2015-12-30 Преобразует коллекцию или массив в карту. * 2024-05-14 "Port `df_index()` from `mage2pro/core`": https://github.com/thehcginstitute-com/m1/issues/600 + * 2024-06-03 + * 1) "Use the `iterable` type": https://github.com/mage2pro/core/issues/403 + * 2) `iterable` is supported by PHP ≥ 7.1: https://3v4l.org/qNX1j + * 3) https://php.net/manual/en/language.types.iterable.php + * https://3v4l.org/AOWmO * @used-by df_mvars() * @param string|Closure $k * @param Traversable|array(int|string => _DO) $a */ -function df_index($k, $a):array {return array_combine(df_column($a, $k), df_ita($a));} +function df_index($k, iterable $a):array {return array_combine(df_column($a, $k), df_ita($a));} /** * 2016-03-25 http://stackoverflow.com/a/1320156