org\bovigo\vfs\vfsStream::inspect PHP Method

inspect() public static method

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.
See also: https://github.com/mikey179/vfsStream/issues/10
Since: 0.10.0
public static inspect ( org\bovigo\vfs\visitor\vfsStreamVisitor $visitor, org\bovigo\vfs\vfsStreamContent $content = null ) : org\bovigo\vfs\visitor\vfsStreamVisitor
$visitor org\bovigo\vfs\visitor\vfsStreamVisitor the visitor who inspects
$content org\bovigo\vfs\vfsStreamContent directory structure to inspect
return org\bovigo\vfs\visitor\vfsStreamVisitor
    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);
    }

Usage Example

 public function testConstruct()
 {
     $this->assertFileExists($this->configDir->url() . DIRECTORY_SEPARATOR . 'test');
     unset($configHandler);
     new ConfigFileHandler('test-process', $this->configDirPath);
     $this->assertEquals(['root' => ['test' => []]], vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
 }
All Usage Examples Of org\bovigo\vfs\vfsStream::inspect