function TesterTrait::getDisplay
Gets the display returned by the last execution of the command or application.
Throws
\RuntimeException If it's called before the execute method
File
-
vendor/
symfony/ console/ Tester/ TesterTrait.php, line 37
Class
- TesterTrait
- @author Amrouche Hamza <hamza.simperfit@gmail.com>
Namespace
Symfony\Component\Console\TesterCode
public function getDisplay(bool $normalize = false) : string {
if (!isset($this->output)) {
throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?');
}
rewind($this->output
->getStream());
$display = stream_get_contents($this->output
->getStream());
if ($normalize) {
$display = str_replace(\PHP_EOL, "\n", $display);
}
return $display;
}