Context
in package
FinalYes
A context containing previously processed arrays and objects when recursively processing a value.
Table of Contents
Properties
Methods
- __construct() : mixed
- Initialises the context.
- __destruct() : mixed
- add() : bool|int|string
- Adds a value to the context.
- contains() : false|int|string
- Checks if the given value exists within the context.
- addArray() : bool|int
- addObject() : string
- containsArray() : false|int
- containsObject() : false|string
Properties
$arrays
private
array<string|int, array<string|int, mixed>>
$arrays
$objects
private
SplObjectStorage
$objects
Methods
__construct()
Initialises the context.
public
__construct() : mixed
__destruct()
public
__destruct() : mixed
Tags
add()
Adds a value to the context.
public
add(array<string|int, mixed>|object &$value) : bool|int|string
Parameters
- $value : array<string|int, mixed>|object
-
the value to add
Tags
Return values
bool|int|string —the ID of the stored value, either as a string or integer
contains()
Checks if the given value exists within the context.
public
contains(array<string|int, mixed>|object &$value) : false|int|string
Parameters
- $value : array<string|int, mixed>|object
-
the value to check
Tags
Return values
false|int|string —the string or integer ID of the stored value if it has already been seen, or false if the value is not stored
addArray()
private
addArray(array<string|int, mixed> &$array) : bool|int
Parameters
- $array : array<string|int, mixed>
Return values
bool|intaddObject()
private
addObject(object $object) : string
Parameters
- $object : object
Return values
stringcontainsArray()
private
containsArray(array<string|int, mixed> &$array) : false|int
Parameters
- $array : array<string|int, mixed>
Return values
false|intcontainsObject()
private
containsObject(object $value) : false|string
Parameters
- $value : object