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 721eda2 commit 1d5ad7a
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions app/code/local/Df/Core/lib/array/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,25 @@ function df_map_k($a1, $a2):array {return df_map($a1, $a2, [], [], DF_BEFORE);}
function df_map_kr($a1, $a2):array {return df_map($a1, $a2, [], [], DF_BEFORE, true);}

/**
* 2016-11-08
* Функция принимает аргументы в любом порядке.
* @param callable|array(int|string => mixed)|array[]\Traversable $a1
* @param callable|array(int|string => mixed)|array[]|\Traversable $a2
* 2016-11-08 Функция принимает аргументы в любом порядке.
* 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_category_children_map()
* @used-by df_modules_my()
* @used-by df_parse_colon()
* @used-by dfe_packages()
* @used-by dfe_portal_stripe_customers()
* @used-by \Df\Config\Source\Block::map()
* @used-by \Df\Directory\Model\ResourceModel\Country\Collection::mapFrom3To2()
* @used-by \Df\Directory\Model\ResourceModel\Country\Collection::mapFromCodeToName()
* @used-by \Df\Framework\Form\Element\Multiselect::getElementHtml()
* @param callable|iterable $a1
* @param callable|iterable $a2
* @return array(int|string => mixed)
*/
function df_map_r($a1, $a2) {return df_map($a1, $a2, [], [], 0, true);}
function df_map_r($a1, $a2):array {return df_map($a1, $a2, [], [], 0, true);}

0 comments on commit 1d5ad7a

Please sign in to comment.