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

Breadcrumb

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

function TesterTrait::getErrorOutput

Gets the output written to STDERR by the application.

Parameters

bool $normalize Whether to normalize end of lines to \n or not:

File

vendor/symfony/console/Tester/TesterTrait.php, line 59

Class

TesterTrait
@author Amrouche Hamza <hamza.simperfit@gmail.com>

Namespace

Symfony\Component\Console\Tester

Code

public function getErrorOutput(bool $normalize = false) : string {
    if (!$this->captureStreamsIndependently) {
        throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.');
    }
    rewind($this->output
        ->getErrorOutput()
        ->getStream());
    $display = stream_get_contents($this->output
        ->getErrorOutput()
        ->getStream());
    if ($normalize) {
        $display = str_replace(\PHP_EOL, "\n", $display);
    }
    return $display;
}

API Navigation

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