Example #1
0
 /**
  * Traverses a sequence storing the path as keys
  *
  * @param int $depth
  * @param string $pathSeparator
  * @return static
  */
 public function traverse($depth = -1, $pathSeparator = '.')
 {
     $recursiveIterator = new RecursiveIteratorIterator(TraverseSequence::make($this, null, $pathSeparator)->setMaxDepth($depth));
     return static::make($recursiveIterator);
 }
Example #2
0
 /**
  * Traverses a sequence storing the path as keys
  *
  * @param int $depth
  * @return static
  */
 public function traverse($depth = -1)
 {
     $recursiveIterator = new RecursiveIteratorIterator(TraverseSequence::make($this)->setMaxDepth($depth));
     return static::make($recursiveIterator);
 }