示例#1
0
 public function getIterator()
 {
     foreach ($this->iterator as $current) {
         Helper\LinqHelper::assertValueIsIterable($current);
         foreach ($current as $value) {
             (yield $value);
         }
     }
 }
示例#2
0
 public function getIterator()
 {
     $func = $this->func;
     foreach ($this->inner as $current) {
         $accept = Helper\LinqHelper::getBoolOrThrowException($func($current));
         if ($accept) {
             (yield $current);
         }
     }
 }
示例#3
0
 public function rewind()
 {
     $this->iterator->rewind();
     if ($this->iterator->valid()) {
         $current = $this->iterator->current();
         $this->currentIterator = Helper\LinqHelper::getIteratorOrThrow($current);
         if ($this->currentIterator != null) {
             $this->currentIterator->rewind();
         }
     } else {
         $this->currentIterator = null;
     }
     $this->key = 0;
 }
示例#4
0
文件: Linq.php 项目: fusonic/linq
 /**
  * Returns all elements except the ones of the given sequence.
  *
  * @param array|\Iterator $second
  * @return  Linq   Returns all items of this not occuring in $second
  */
 public function except($second)
 {
     LinqHelper::assertArgumentIsIterable($second, "second");
     return new Linq(new ExceptIterator($this->iterator, LinqHelper::getIteratorOrThrow($second)));
 }
示例#5
0
 public function accept()
 {
     $func = $this->func;
     $current = $this->current();
     return Helper\LinqHelper::getBoolOrThrowException($func($current));
 }