ConsoleErrorRenderer
in package
implements
ErrorRendererInterface
Plain text error rendering with a stack trace.
Writes to STDERR via a Cake\Console\ConsoleOutput instance for console environments
Table of Contents
Interfaces
- ErrorRendererInterface
- Interface for PHP error rendering implementations
Properties
- $output : ConsoleOutput
- $trace : bool
Methods
- __construct() : mixed
- Constructor.
- render() : string
- Render output for the provided error.
- write() : void
- Write output to the renderer's output stream
Properties
$output
protected
ConsoleOutput
$output
$trace
protected
bool
$trace
= false
Methods
__construct()
Constructor.
public
__construct(array<string|int, mixed> $config) : mixed
Options
-
stderr
- The ConsoleOutput instance to use. Defaults tophp://stderr
-
trace
- Whether or not stacktraces should be output.
Parameters
- $config : array<string|int, mixed>
-
Error handling configuration.
render()
Render output for the provided error.
public
render(PhpError $error, bool $debug) : string
Parameters
- $error : PhpError
-
The error to be rendered.
- $debug : bool
-
Whether or not the application is in debug mode.
Tags
Return values
string —The output to be echoed.
write()
Write output to the renderer's output stream
public
write(string $out) : void
Parameters
- $out : string
-
The content to output.