Skip to content

Commit ab68609

Browse files
committed
✨ add to_array() function an alias of arrayfy() function
Signed-off-by: otengkwame <[email protected]>
1 parent d833bb9 commit ab68609

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Core/helpers/webby_helper.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,23 @@ function compare_json($first_object, $second_object)
12881288
}
12891289
}
12901290

1291+
if ( ! function_exists('to_array'))
1292+
{
1293+
/**
1294+
* Alias of arrayfy()
1295+
*
1296+
* @param object|array $object
1297+
* @param bool $asGenerator
1298+
* @param int $threshold
1299+
* @return \Generator|array
1300+
*/
1301+
function to_array($object, $asGenerator = false, $threshold = 1000)
1302+
{
1303+
return arrayfy($object, $asGenerator, $threshold);
1304+
}
1305+
1306+
}
1307+
12911308
if ( ! function_exists('to_generator'))
12921309
{
12931310
/**

0 commit comments

Comments
 (0)