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

Method Detail

__construct() public

__construct(int $maxDepth)

Constructor

Parameters

int $maxDepth

The desired depth of dump output.

getReferenceId() public

getReferenceId(object $object)

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)

Check whether an object has been seen before.

Parameters

object $object

The object to get a reference for.

Returns

bool

remainingDepth() public

remainingDepth()

Get the remaining depth levels

Returns

int

withAddedDepth() public

withAddedDepth()

Return a clone with increased depth.

Returns

static

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Error.Debug.DebugContext.html