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

Breadcrumb

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

function ConsoleOutput::__construct

Parameters

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):

Overrides StreamOutput::__construct

File

vendor/symfony/console/Output/ConsoleOutput.php, line 40

Class

ConsoleOutput
ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR.

Namespace

Symfony\Component\Console\Output

Code

public function __construct(int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) {
    parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
    if (null === $formatter) {
        // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter.
        $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated);
        return;
    }
    $actualDecorated = $this->isDecorated();
    $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
    if (null === $decorated) {
        $this->setDecorated($actualDecorated && $this->stderr
            ->isDecorated());
    }
}

API Navigation

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