org\bovigo\vfs\vfsStream::inspect PHP 메소드

inspect() 공개 정적인 메소드

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.
또한 보기: https://github.com/mikey179/vfsStream/issues/10
부터: 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
리턴 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