Skip to content

Commit 747e67f

Browse files
committed
Fix PHPDoc + PSR2
1 parent b5f1cf5 commit 747e67f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/iterable-functions.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
/**
66
* Check wether or not a variable is iterable (i.e array or \Traversable)
7-
* @param array|\Traversable $iterable
7+
*
8+
* @param array|\Traversable $iterable
89
* @return bool
910
*/
1011
function is_iterable($iterable)
@@ -17,7 +18,8 @@ function is_iterable($iterable)
1718

1819
/**
1920
* Copy the iterable into an array. If the iterable is already an array, return it.
20-
* @param array|\Traversable $iterable
21+
*
22+
* @param array|\Traversable $iterable
2123
* @return array
2224
*/
2325
function iterable_to_array($iterable)
@@ -27,6 +29,13 @@ function iterable_to_array($iterable)
2729
}
2830

2931
if (!function_exists('iterable_to_traversable')) {
32+
33+
/**
34+
* If the iterable is not intance of \Traversable, it is an array => convert it to an ArrayIterator.
35+
*
36+
* @param $iterable
37+
* @return \Traversable
38+
*/
3039
function iterable_to_traversable($iterable)
3140
{
3241
if ($iterable instanceof Traversable) {

0 commit comments

Comments
 (0)