You are here

public function vfsStreamStructureVisitor::visitDirectory in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitor.php \org\bovigo\vfs\visitor\vfsStreamStructureVisitor::visitDirectory()

visit a directory and process it

Parameters

vfsStreamDirectory $dir:

Return value

vfsStreamStructureVisitor

Overrides vfsStreamVisitor::visitDirectory

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitor.php, line 76

Class

vfsStreamStructureVisitor
Visitor which traverses a content structure recursively to create an array structure from it.

Namespace

org\bovigo\vfs\visitor

Code

public function visitDirectory(vfsStreamDirectory $dir) {
  $this->current[$dir
    ->getName()] = array();
  $tmp =& $this->current;
  $this->current =& $tmp[$dir
    ->getName()];
  foreach ($dir as $child) {
    $this
      ->visit($child);
  }
  $this->current =& $tmp;
  return $this;
}