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

Breadcrumb

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

function OutputFormatter::__construct

Initializes console output formatter.

Parameters

OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances:

2 calls to OutputFormatter::__construct()
HtmlOutputFormatter::__construct in vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php
HtmlOutputFormatter::__construct in vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php
1 method overrides OutputFormatter::__construct()
HtmlOutputFormatter::__construct in vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php

File

vendor/symfony/console/Formatter/OutputFormatter.php, line 69

Class

OutputFormatter
Formatter class for console output.

Namespace

Symfony\Component\Console\Formatter

Code

public function __construct(bool $decorated = false, array $styles = []) {
    $this->setStyle('error', new OutputFormatterStyle('white', 'red'));
    $this->setStyle('info', new OutputFormatterStyle('green'));
    $this->setStyle('comment', new OutputFormatterStyle('yellow'));
    $this->setStyle('question', new OutputFormatterStyle('black', 'cyan'));
    foreach ($styles as $name => $style) {
        $this->setStyle($name, $style);
    }
    $this->styleStack = new OutputFormatterStyleStack();
}

API Navigation

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