Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StreamOutput.php

function StreamOutput::__construct

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

4 calls to StreamOutput::__construct()
ConsoleOutput::__construct in vendor/symfony/console/Output/ConsoleOutput.php
ConsoleOutput::__construct in vendor/symfony/console/Output/ConsoleOutput.php
ConsoleSectionOutput::__construct in vendor/symfony/console/Output/ConsoleSectionOutput.php
ConsoleSectionOutput::__construct in vendor/symfony/console/Output/ConsoleSectionOutput.php
2 methods override StreamOutput::__construct()
ConsoleOutput::__construct in vendor/symfony/console/Output/ConsoleOutput.php
ConsoleSectionOutput::__construct in vendor/symfony/console/Output/ConsoleSectionOutput.php

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, int $verbosity = self::VERBOSITY_NORMAL, ?bool $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;
    $decorated ??= $this->hasColorSupport();
    parent::__construct($verbosity, $decorated, $formatter);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal