| 1 | <?php |
||
| 10 | trait CycleTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Make an iterator returning elements from this iterable and saving a |
||
| 14 | * copy of each. When the iterable is exhausted, return elements from |
||
| 15 | * the saved copy. Repeats indefinitely. |
||
| 16 | * |
||
| 17 | * > iterable('ABCD')->cycle() |
||
| 18 | * A B C D A B C D A B C D ... |
||
| 19 | * |
||
| 20 | * @return CycleIterator |
||
| 21 | */ |
||
| 22 | 11 | public function cycle() |
|
| 30 | } |
||
| 31 |