From 04bc65cf2502e8186262226b00ba01725a9be355 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 3 Jun 2024 01:11:24 +0100 Subject: [PATCH] https://github.com/mage2pro/core/issues/403 --- app/code/local/Df/Core/lib/array/other/af.php | 2 +- app/code/local/Df/Qa/lib/dump.php | 2 +- app/code/local/Df/Qa/lib/validation/assert.php | 4 ++-- app/code/local/Df/Qa/lib/validation/error.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/local/Df/Core/lib/array/other/af.php b/app/code/local/Df/Core/lib/array/other/af.php index 292b6782ff..ddedbaddd0 100644 --- a/app/code/local/Df/Core/lib/array/other/af.php +++ b/app/code/local/Df/Core/lib/array/other/af.php @@ -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 */ diff --git a/app/code/local/Df/Qa/lib/dump.php b/app/code/local/Df/Qa/lib/dump.php index 29b3ea64fd..dbffed4196 100644 --- a/app/code/local/Df/Qa/lib/dump.php +++ b/app/code/local/Df/Qa/lib/dump.php @@ -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() diff --git a/app/code/local/Df/Qa/lib/validation/assert.php b/app/code/local/Df/Qa/lib/validation/assert.php index aacbc30a85..cc824e722c 100644 --- a/app/code/local/Df/Qa/lib/validation/assert.php +++ b/app/code/local/Df/Qa/lib/validation/assert.php @@ -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) );} diff --git a/app/code/local/Df/Qa/lib/validation/error.php b/app/code/local/Df/Qa/lib/validation/error.php index 0ef6055cd0..85c7b576ba 100644 --- a/app/code/local/Df/Qa/lib/validation/error.php +++ b/app/code/local/Df/Qa/lib/validation/error.php @@ -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()