Debug: ezcDebugStacktraceIterator
[ ]
[ Example stylesheet ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDebugStacktraceIterator
|
Base iterator class to wrap stack traces. [
source]
Implemented Interfaces
- Iterator (internal interface)
- ArrayAccess (internal interface)
- Countable (internal interface)
This class provides a basis for stack trace iterators that are stored for each call to
ezcDebug::log() if ezcDebugOptions::$stackTrace is switched on or the specific parameter is set. The stack trace iterator needs to ensure, that the created stack trace is converted to the format understandable by the ezcDebugFormatter as defined in
ezcDebugStacktraceIterator::unifyStackElement().
Descendents
Member Variables
Method Summary
|
public void |
__construct(
$stackTrace, [$removeElements = 2], $options )
Creates a new stack trace iterator. |
|
public int |
count(
)
Returns the number of elements in the iterator. |
|
public mixed |
current(
)
Returns the currently selected element of the iterator. |
|
public mixed |
key(
)
Returns the key of the currently selected element of the iterator. |
|
public mixed |
next(
)
Advances the iterator to the next element. |
|
public bool |
offsetExists(
$offset )
Returns if the given offset exists. |
|
public mixed |
offsetGet(
$offset )
Returns the value assigned to the given offset. |
|
public void |
offsetSet(
$offset, $value )
It is not allowed to use this method with this iterator. |
|
public void |
offsetUnset(
$offset )
It is not allowed to use this method with this iterator. |
|
protected void |
prepare(
$stackTrace, $removeElements )
Prepares the stack trace for being stored in the iterator instance. |
|
public mixed |
rewind(
)
Resets the iterator to the first element. |
|
protected abstract array |
unifyStackElement(
$stackElement )
Unifies a stack element for being returned to the formatter. |
|
public bool |
valid(
)
Returns if the iterator is on a valid element or at the end. |
Methods
__construct
void __construct(
mixed
$stackTrace, [int
$removeElements = 2],
ezcDebugOptions
$options )
Creates a new stack trace iterator.
Parameters
| Name |
Type |
Description |
$stackTrace |
mixed |
|
$removeElements |
int |
|
$options |
ezcDebugOptions |
|
count
int count(
)
Returns the number of elements in the iterator.
This method is part of the Countable interface.
current
mixed current(
)
Returns the currently selected element of the iterator.
This method is part of the Iterator interface.
key
mixed key(
)
Returns the key of the currently selected element of the iterator.
This method is part of the Iterator interface.
next
mixed next(
)
Advances the iterator to the next element.
This method is part of the Iterator interface.
offsetExists
bool offsetExists(
mixed
$offset )
Returns if the given offset exists.
This method is part of the ArrayAccess interface.
Parameters
| Name |
Type |
Description |
$offset |
mixed |
|
offsetGet
mixed offsetGet(
mixed
$offset )
Returns the value assigned to the given offset.
This method is part of the ArrayAccess interface.
Parameters
| Name |
Type |
Description |
$offset |
mixed |
|
offsetSet
void offsetSet(
mixed
$offset, mixed
$value )
It is not allowed to use this method with this iterator.
This method is part of the ArrayAccess interface.
Parameters
| Name |
Type |
Description |
$offset |
mixed |
|
$value |
mixed |
|
Throws
| Class | Description |
ezcDebugException |
|
offsetUnset
void offsetUnset(
mixed
$offset )
It is not allowed to use this method with this iterator.
This method is part of the ArrayAccess interface.
Parameters
| Name |
Type |
Description |
$offset |
mixed |
|
Throws
| Class | Description |
ezcDebugException |
|
prepare
void prepare(
array
$stackTrace, int
$removeElements )
Prepares the stack trace for being stored in the iterator instance.
This method is called by
ezcDebugStacktraceIterator::__construct() before the stack trace is stored in the corresponding property. The given array can be manipulated as needed to prepare the trace and the array to store internally must be returned. The basic implementation removes $removeElements number of elements from the start of the trace array and reduces the array to ezcDebugOptions::$stackTraceDepth elements.
Parameters
| Name |
Type |
Description |
$stackTrace |
array |
|
$removeElements |
int |
|
Redefined in descendants as
rewind
mixed rewind(
)
Resets the iterator to the first element.
This method is part of the Iterator interface.
unifyStackElement
array unifyStackElement(
mixed
$stackElement )
Unifies a stack element for being returned to the formatter.
This method ensures that an element of the stack trace conforms to the format expected by a
ezcDebugOutputFormatter. The format is defined as follows:
1. array(
2. 'file' => '<fullpathtofile>',
3. 'line' => <lineno>,
4. 'function' => '<functionname>',
5. 'class' => '<classname>',
6. 'params' => array(
7. <param_no> => '<paramvalueinfo>',
8. <param_no> => '<paramvalueinfo>',
9. <param_no> => '<paramvalueinfo>',
10. ...
11. )
12. )
Parameters
| Name |
Type |
Description |
$stackElement |
mixed |
|
Redefined in descendants as
valid
bool valid(
)
Returns if the iterator is on a valid element or at the end.
This method is part of the Iterator interface.
Last updated: Tue, 27 May 2008