\Whoops\ExceptionFrame

Summary

Methods
Properties
Constants
__construct()
getFile()
getLine()
getClass()
getFunction()
getArgs()
getFileContents()
addComment()
getComments()
getRawFrame()
getFileLines()
serialize()
unserialize()
equals()
isApplication()
setApplication()
No public properties found
No constants found
No protected methods found
$frame
$fileContentsCache
$comments
$application
N/A
No private methods found
No private properties found
N/A

Properties

$frame

$frame : array

Type

array

$fileContentsCache

$fileContentsCache : string

Type

string

$comments

$comments : array<mixed,array>

Type

array<mixed,array>

$application

$application : boolean

Type

boolean

Methods

__construct()

__construct(array  $frame) 

Parameters

array $frame

getFile()

getFile(boolean  $shortened = false) : string|null

Parameters

boolean $shortened

Returns

string|null

getLine()

getLine() : integer|null

Returns

integer|null

getClass()

getClass() : string|null

Returns

string|null

getFunction()

getFunction() : string|null

Returns

string|null

getArgs()

getArgs() : array

Returns

array

getFileContents()

getFileContents() : string|null

Returns the full contents of the file for this frame, if it's known.

Returns

string|null

addComment()

addComment(string  $comment, string  $context = 'global') 

Adds a comment to this frame, that can be received and used by other handlers. For example, the PrettyPage handler can attach these comments under the code for each frame.

An interesting use for this would be, for example, code analysis & annotations.

Parameters

string $comment
string $context

Optional string identifying the origin of the comment

getComments()

getComments(string  $filter = null) : array<mixed,array>

Returns all comments for this frame. Optionally allows a filter to only retrieve comments from a specific context.

Parameters

string $filter

Returns

array<mixed,array>

getRawFrame()

getRawFrame() : array

Returns the array containing the raw frame data from which this Frame object was built

Returns

array

getFileLines()

getFileLines(integer  $start, integer  $length = null) : array<mixed,string>|null

Returns the contents of the file for this frame as an array of lines, and optionally as a clamped range of lines.

NOTE: lines are 0-indexed

Parameters

integer $start
integer $length

Throws

\InvalidArgumentException

if $length is less than or equal to 0

Returns

array<mixed,string>|null

Examples

all lines for this file $frame->getFileLines(); // => array( 0 => '<?php', 1 => '...', ...)
** File not found : Get **
one line for this file, starting at line 10 (zero-indexed, remember!) $frame->getFileLines(9, 1); // array( 10 => '...', 11 => '...')
** File not found : Get **

serialize()

serialize() : string

Implements the Serializable interface, with special steps to also save the existing comments.

Returns

string

unserialize()

unserialize(string  $serializedFrame) 

Unserializes the frame data, while also preserving any existing comment data.

Parameters

string $serializedFrame

equals()

equals(\Whoops\Exception\Frame  $frame) : boolean

Compares Frame against one another

Parameters

\Whoops\Exception\Frame $frame

Returns

boolean

isApplication()

isApplication() : boolean

Returns whether this frame belongs to the application or not.

Returns

boolean

setApplication()

setApplication(boolean  $application) 

Mark as an frame belonging to the application.

Parameters

boolean $application