/**
  * Return stream of current iterator object. If this object is stream, just return itself.
  *
  * @return Stream
  */
 public function streamify()
 {
     if ($this instanceof Stream) {
         return $this;
     }
     return Stream::from($this);
 }
Exemple #2
0
 /**
  * Define stream function in Global.
  *
  * @param \Iterator|\IteratorAggregate|array $source
  * @return Stream returns a streaming object.
  */
 function stream($source)
 {
     return Stream::from($source);
 }