You are here

public static function vfsStream::inspect in Zircon Profile 8

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

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.

@since 0.10.0

Parameters

vfsStreamVisitor $visitor the visitor who inspects:

vfsStreamContent $content directory structure to inspect:

Return value

vfsStreamVisitor

Throws

\InvalidArgumentException

See also

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

4 calls to vfsStream::inspect()
KernelTestBase::vfsDump in core/tests/Drupal/KernelTests/KernelTestBase.php
Dumps the current state of the virtual filesystem to STDOUT.
vfsStreamTestCase::inspectWithContentGivesContentToVisitor in vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php
@test @group issue_10 @since 0.10.0
vfsStreamTestCase::inspectWithoutContentAndWithoutRootThrowsInvalidArgumentException in vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php
@test @group issue_10 @expectedException \InvalidArgumentException @since 0.10.0
vfsStreamTestCase::inspectWithoutContentGivesRootToVisitor in vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php
@test @group issue_10 @since 0.10.0

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php, line 407

Class

vfsStream
Some utility methods for vfsStream.

Namespace

org\bovigo\vfs

Code

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);
}