This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x426B4875d0Aef8fCA2a2ccB762Cd57254E32BAB6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
class IteratorHelper | |
{ | |
public static function iteratorChunk(\Iterator $i, int $size = 100): \Generator | |
{ | |
for ($i = static::remaining($i); $i->valid(); $i = static::remaining($i)) { | |
yield new \LimitIterator($i, 0, $size); | |
} |