You are here

public function vfsStreamAbstractVisitor::visit in Zircon Profile 8

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

visit a content and process it

Parameters

vfsStreamContent $content:

Return value

vfsStreamVisitor

Throws

\InvalidArgumentException

Overrides vfsStreamVisitor::visit

2 calls to vfsStreamAbstractVisitor::visit()
vfsStreamPrintVisitor::visitDirectory in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitor.php
visit a directory and process it
vfsStreamStructureVisitor::visitDirectory in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitor.php
visit a directory and process it

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php, line 29

Class

vfsStreamAbstractVisitor
Abstract base class providing an implementation for the visit() method.

Namespace

org\bovigo\vfs\visitor

Code

public function visit(vfsStreamContent $content) {
  switch ($content
    ->getType()) {
    case vfsStreamContent::TYPE_BLOCK:
      $this
        ->visitBlockDevice($content);
      break;
    case vfsStreamContent::TYPE_FILE:
      $this
        ->visitFile($content);
      break;
    case vfsStreamContent::TYPE_DIR:
      if (!$content
        ->isDot()) {
        $this
          ->visitDirectory($content);
      }
      break;
    default:
      throw new \InvalidArgumentException('Unknown content type ' . $content
        ->getType() . ' for ' . $content
        ->getName());
  }
  return $this;
}