Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. vfsStreamAbstractVisitor.php

class vfsStreamAbstractVisitor

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

@since 0.10.0

Hierarchy

  • class \org\bovigo\vfs\visitor\vfsStreamAbstractVisitor implements \org\bovigo\vfs\visitor\vfsStreamVisitor

Expanded class hierarchy of vfsStreamAbstractVisitor

See also

https://github.com/mikey179/vfsStream/issues/10

File

vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php, line 20

Namespace

org\bovigo\vfs\visitor
View source
abstract class vfsStreamAbstractVisitor implements vfsStreamVisitor {
    
    /**
     * visit a content and process it
     *
     * @param   vfsStreamContent  $content
     * @return  vfsStreamVisitor
     * @throws  \InvalidArgumentException
     */
    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;
    }
    
    /**
     * visit a block device and process it
     *
     * @param   vfsStreamBlock $block
     * @return  vfsStreamVisitor
     */
    public function visitBlockDevice(vfsStreamBlock $block) {
        return $this->visitFile($block);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
vfsStreamAbstractVisitor::visit public function visit a content and process it Overrides vfsStreamVisitor::visit
vfsStreamAbstractVisitor::visitBlockDevice public function visit a block device and process it Overrides vfsStreamVisitor::visitBlockDevice 2
vfsStreamVisitor::visitDirectory public function visit a directory and process it 2
vfsStreamVisitor::visitFile public function visit a file and process it 2

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal