You are here

public function vfsStreamPrintVisitor::__construct in Zircon Profile 8

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

constructor

If no file pointer given it will fall back to STDOUT.

@api

Parameters

resource $out optional:

Throws

\InvalidArgumentException

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitor.php, line 46

Class

vfsStreamPrintVisitor
Visitor which traverses a content structure recursively to print it to an output stream.

Namespace

org\bovigo\vfs\visitor

Code

public function __construct($out = STDOUT) {
  if (is_resource($out) === false || get_resource_type($out) !== 'stream') {
    throw new \InvalidArgumentException('Given filepointer is not a resource of type stream');
  }
  $this->out = $out;
}