Skip to content

Commit

Permalink
https://github.com/mage2pro/core/issues/403
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jun 3, 2024
1 parent 64cc641 commit b92240c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/code/local/Df/Core/lib/array/other.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b92240c

Please sign in to comment.