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 f15db9d commit 04bc65c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/code/local/Df/Core/lib/array/other/af.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function dfaf($a, $b):array {
$cb = is_callable($b); /** @var bool $ca */
if (!$ca || !$cb) {
df_assert($ca || $cb);
$r = $ca ? [df_assert_traversable($b), $a] : [df_assert_traversable($a), $b];
$r = $ca ? [df_assert_iterable($b), $a] : [df_assert_iterable($a), $b];
}
else {
$ta = is_iterable($a); /** @var bool $ta */
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/Df/Qa/lib/dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function df_dump_ds($v):string {return df_json_dont_sort(function() use($v):stri
* @see df_dump()
* @used-by df_ar()
* @used-by df_assert_gd()
* @used-by df_assert_traversable()
* @used-by df_assert_iterable()
* @used-by df_customer()
* @used-by df_oq_currency_c()
* @used-by df_order()
Expand Down
4 changes: 2 additions & 2 deletions app/code/local/Df/Qa/lib/validation/assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ function df_assert_sne($v, $sl = 0) {

/**
* 2016-08-09
* 2024-03-05 "Port `df_assert_traversable()` from `mage2pro/core`": https://github.com/thehcginstitute-com/m1/issues/459
* 2024-03-05 "Port `df_assert_iterable()` from `mage2pro/core`": https://github.com/thehcginstitute-com/m1/issues/459
* @used-by dfaf()
* @param Traversable|array $v
* @param string|T $m [optional]
* @return Traversable|array
* @throws E
*/
function df_assert_traversable($v, $m = null) {return is_iterable($v) ? $v : df_error($m ?:
function df_assert_iterable($v, $m = null) {return is_iterable($v) ? $v : df_error($m ?:
'A variable is expected to be a Traversable or an array, ' . 'but actually it is %s.', df_type($v)
);}

Expand Down
2 changes: 1 addition & 1 deletion app/code/local/Df/Qa/lib/validation/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @used-by df_assert_ne()
* @used-by df_assert_nef()
* @used-by df_assert_oq()
* @used-by df_assert_traversable()
* @used-by df_assert_iterable()
* @used-by df_asset_url()
* @used-by df_bool()
* @used-by df_call()
Expand Down

0 comments on commit 04bc65c

Please sign in to comment.