コード例 #1
0
ファイル: CSV.php プロジェクト: mhitza/file-enumerators
 public function consume($handle)
 {
     while (false !== ($row = fgetcsv($handle, 0, $this->delimiter))) {
         if (false === is_null($this->transformer)) {
             (yield $this->transformer->apply($row));
         } else {
             (yield $row);
         }
     }
 }
コード例 #2
0
ファイル: Line.php プロジェクト: mhitza/file-enumerators
 public function consume($handle)
 {
     while (false !== ($line = fgets($handle))) {
         if (false === is_null($this->transformer)) {
             (yield $this->transformer->apply($line));
         } else {
             (yield $line);
         }
     }
 }