org\bovigo\vfs\visitor\vfsStreamVisitor::visit PHP Метод

visit() публичный Метод

visit a content and process it
public visit ( org\bovigo\vfs\vfsStreamContent $content ) : org\bovigo\vfs\visitor\vfsStreamVisitor
$content org\bovigo\vfs\vfsStreamContent
Результат org\bovigo\vfs\visitor\vfsStreamVisitor
    public function visit(vfsStreamContent $content);

Usage Example

Пример #1
0
 /**
  * use visitor to inspect a content structure
  *
  * If the given content is null it will fall back to use the current root
  * directory of the stream wrapper.
  *
  * Returns given visitor for method chaining comfort.
  *
  * @param   vfsStreamVisitor  $visitor  the visitor who inspects
  * @param   vfsStreamContent  $content  directory structure to inspect
  * @return  vfsStreamVisitor
  * @throws  \InvalidArgumentException
  * @since   0.10.0
  * @see     https://github.com/mikey179/vfsStream/issues/10
  */
 public static function inspect(vfsStreamVisitor $visitor, vfsStreamContent $content = null)
 {
     if (null !== $content) {
         return $visitor->visit($content);
     }
     $root = vfsStreamWrapper::getRoot();
     if (null === $root) {
         throw new \InvalidArgumentException('No content given and no root directory set.');
     }
     return $visitor->visitDirectory($root);
 }