/** * @param Pipe $pipe * @return Pipeline */ public function pipe(Pipe $pipe) { if (!$this->input instanceof Pipe) { $this->input = $pipe; } if ($this->output) { $pipe->input($this->output); } $this->output = $pipe; return $this; }
protected function filter() { while (parent::valid() && !call_user_func($this->callback, parent::current(), parent::key())) { parent::next(); } }
public function rewind() { $this->count = 0; parent::rewind(); }
public function current() { return call_user_func($this->callback, parent::current(), parent::key()); }