You are here

public function StreamOutput::__construct in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Output/StreamOutput.php \Symfony\Component\Console\Output\StreamOutput::__construct()

Constructor.

Parameters

resource $stream A stream resource:

int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface):

bool|null $decorated Whether to decorate messages (null for auto-guessing):

OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter):

Throws

\InvalidArgumentException When first argument is not a real stream

Overrides Output::__construct

1 call to StreamOutput::__construct()
ConsoleOutput::__construct in vendor/symfony/console/Output/ConsoleOutput.php
Constructor.
1 method overrides StreamOutput::__construct()
ConsoleOutput::__construct in vendor/symfony/console/Output/ConsoleOutput.php
Constructor.

File

vendor/symfony/console/Output/StreamOutput.php, line 43

Class

StreamOutput
StreamOutput writes the output to a given stream.

Namespace

Symfony\Component\Console\Output

Code

public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) {
  if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
    throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.');
  }
  $this->stream = $stream;
  if (null === $decorated) {
    $decorated = $this
      ->hasColorSupport();
  }
  parent::__construct($verbosity, $decorated, $formatter);
}