Class DebugContext
Context tracking for Debugger::exportVar()
This class is used by Debugger to track element depth, and prevent cyclic references from being traversed multiple times.
Namespace: Cake\Error\Debug
Method Summary
-
__construct() public
Constructor
-
getReferenceId() public
Get the reference ID for an object.
-
hasReference() public
Check whether an object has been seen before.
-
remainingDepth() public
Get the remaining depth levels
-
withAddedDepth() public
Return a clone with increased depth.
Method Detail
__construct() ¶ public
__construct(int $maxDepth)
Constructor
Parameters
-
int
$maxDepth The desired depth of dump output.
getReferenceId() ¶ public
getReferenceId(object $object): int
Get the reference ID for an object.
If this object does not exist in the reference storage, it will be added and the id will be returned.
Parameters
-
object
$object The object to get a reference for.
Returns
int
hasReference() ¶ public
hasReference(object $object): bool
Check whether an object has been seen before.
Parameters
-
object
$object The object to get a reference for.
Returns
bool
withAddedDepth() ¶ public
withAddedDepth(): static
Return a clone with increased depth.
Returns
static