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\TesterCode
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;
}