StackTracePrinter
in package
This class provides Spitfire with tools to print a pretty and informative Stack trace of the error it received.
Table of Contents
- LINE_TYPE_ERROR = 'error'
- LINE_TYPE_NORMAL = 'normal'
- LINE_TYPE_WARN = 'warn'
- $exception : Exception
- The exception being printed. It provides the necessary information for the Printer to display it to a user in a way that becomes useful to them.
- __construct() : mixed
- Creates the printer. This allows the application to return a "nice" and helpful error to the developer to avoid him needing to revisit the entire application code and having an excerpt on screen the moment it fails.
- __toString() : mixed
- iterateTrace() : string
- Walks over the components of the stack trace being printed and stringifies them. Please note that, in order to do so, it relies on the overriden and implemented methods from the child class.
- makeCSS() : mixed
- makeExcerpt() : mixed
- makeTrace() : mixed
- printLine() : mixed
- printMethodSignature() : mixed
- stringifyArgs() : mixed
- stringifyEntry() : mixed
- wrapExcerpt() : mixed
- wrapMethodSignature() : mixed
- wrapStackTrace() : mixed
Constants
LINE_TYPE_ERROR
public
mixed
LINE_TYPE_ERROR
= 'error'
LINE_TYPE_NORMAL
public
mixed
LINE_TYPE_NORMAL
= 'normal'
LINE_TYPE_WARN
public
mixed
LINE_TYPE_WARN
= 'warn'
Properties
$exception
The exception being printed. It provides the necessary information for the Printer to display it to a user in a way that becomes useful to them.
private
Exception
$exception
Methods
__construct()
Creates the printer. This allows the application to return a "nice" and helpful error to the developer to avoid him needing to revisit the entire application code and having an excerpt on screen the moment it fails.
public
__construct(Exception $e) : mixed
Parameters
- $e : Exception
Return values
mixed —__toString()
public
__toString() : mixed
Return values
mixed —iterateTrace()
Walks over the components of the stack trace being printed and stringifies them. Please note that, in order to do so, it relies on the overriden and implemented methods from the child class.
public
iterateTrace() : string
Tags
Return values
string —makeCSS()
public
abstract makeCSS() : mixed
Return values
mixed —makeExcerpt()
public
makeExcerpt(mixed $file, mixed $line) : mixed
Parameters
- $file : mixed
- $line : mixed
Return values
mixed —makeTrace()
public
makeTrace() : mixed
Return values
mixed —printLine()
public
abstract printLine(mixed $line[, mixed $type = StackTracePrinter::LINE_TYPE_NORMAL ]) : mixed
Parameters
- $line : mixed
- $type : mixed = StackTracePrinter::LINE_TYPE_NORMAL
Return values
mixed —printMethodSignature()
public
abstract printMethodSignature(mixed $function, mixed $args) : mixed
Parameters
- $function : mixed
- $args : mixed
Return values
mixed —stringifyArgs()
public
stringifyArgs(mixed $args) : mixed
Parameters
- $args : mixed
Return values
mixed —stringifyEntry()
public
stringifyEntry(mixed $entry) : mixed
Parameters
- $entry : mixed
Return values
mixed —wrapExcerpt()
public
abstract wrapExcerpt(mixed $html, mixed $startLine) : mixed
Parameters
- $html : mixed
- $startLine : mixed
Return values
mixed —wrapMethodSignature()
public
abstract wrapMethodSignature(mixed $html) : mixed
Parameters
- $html : mixed
Return values
mixed —wrapStackTrace()
public
abstract wrapStackTrace(mixed $html, mixed $title) : mixed
Parameters
- $html : mixed
- $title : mixed