Data
in package
implements
ArrayAccess, Countable, IteratorAggregate
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Properties
- $context : array<string|int, mixed>
- $data : array<string|int, mixed>
- $key : int|string
- $maxDepth : int
- $maxItemsPerDepth : int
- $position : int
- $useRefHandles : int
Methods
- __construct() : mixed
- __get() : mixed
- __isset() : bool
- __toString() : string
- count() : int
- dump() : mixed
- Dumps data with a DumperInterface dumper.
- getIterator() : Traversable
- getType() : string|null
- getValue() : string|int|float|bool|array<string|int, mixed>|array<string|int, Data>|null
- Returns a native representation of the original value.
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : void
- offsetUnset() : void
- seek() : static|null
- Seeks to a specific key in nested data structures.
- withContext() : static
- withMaxDepth() : static
- Returns a depth limited clone of $this.
- withMaxItemsPerDepth() : static
- Limits the number of elements per depth level.
- withRefHandles() : static
- Enables/disables objects' identifiers tracking.
- dumpChildren() : int
- Dumps children of hash structures.
- dumpItem() : mixed
- Depth-first dumping of items.
- getStub() : mixed
Properties
$context
private
array<string|int, mixed>
$context
= []
$data
private
array<string|int, mixed>
$data
$key
private
int|string
$key
= 0
$maxDepth
private
int
$maxDepth
= 20
$maxItemsPerDepth
private
int
$maxItemsPerDepth
= -1
$position
private
int
$position
= 0
$useRefHandles
private
int
$useRefHandles
= -1
Methods
__construct()
public
__construct(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
An array as returned by ClonerInterface::cloneVar()
__get()
public
__get(string $key) : mixed
Parameters
- $key : string
__isset()
public
__isset(string $key) : bool
Parameters
- $key : string
Return values
bool__toString()
public
__toString() : string
Return values
stringcount()
public
count() : int
Return values
intdump()
Dumps data with a DumperInterface dumper.
public
dump(DumperInterface $dumper) : mixed
Parameters
- $dumper : DumperInterface
getIterator()
public
getIterator() : Traversable
Return values
TraversablegetType()
public
getType() : string|null
Return values
string|nullgetValue()
Returns a native representation of the original value.
public
getValue([array<string|int, mixed>|bool $recursive = false ]) : string|int|float|bool|array<string|int, mixed>|array<string|int, Data>|null
Parameters
- $recursive : array<string|int, mixed>|bool = false
-
Whether values should be resolved recursively or not
Return values
string|int|float|bool|array<string|int, mixed>|array<string|int, Data>|nulloffsetExists()
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
offsetSet()
public
offsetSet(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
offsetUnset()
public
offsetUnset(mixed $key) : void
Parameters
- $key : mixed
seek()
Seeks to a specific key in nested data structures.
public
seek(string|int $key) : static|null
Parameters
- $key : string|int
Return values
static|nullwithContext()
public
withContext(array<string|int, mixed> $context) : static
Parameters
- $context : array<string|int, mixed>
Return values
staticwithMaxDepth()
Returns a depth limited clone of $this.
public
withMaxDepth(int $maxDepth) : static
Parameters
- $maxDepth : int
Return values
staticwithMaxItemsPerDepth()
Limits the number of elements per depth level.
public
withMaxItemsPerDepth(int $maxItemsPerDepth) : static
Parameters
- $maxItemsPerDepth : int
Return values
staticwithRefHandles()
Enables/disables objects' identifiers tracking.
public
withRefHandles(bool $useRefHandles) : static
Parameters
- $useRefHandles : bool
-
False to hide global ref. handles
Return values
staticdumpChildren()
Dumps children of hash structures.
private
dumpChildren(DumperInterface $dumper, Cursor $parentCursor, array<string|int, mixed> &$refs, array<string|int, mixed> $children, int $hashCut, int $hashType, bool $dumpKeys) : int
Parameters
- $dumper : DumperInterface
- $parentCursor : Cursor
- $refs : array<string|int, mixed>
- $children : array<string|int, mixed>
- $hashCut : int
- $hashType : int
- $dumpKeys : bool
Return values
int —The final number of removed items
dumpItem()
Depth-first dumping of items.
private
dumpItem(DumperInterface $dumper, Cursor $cursor, array<string|int, mixed> &$refs, mixed $item) : mixed
Parameters
- $dumper : DumperInterface
- $cursor : Cursor
- $refs : array<string|int, mixed>
- $item : mixed
-
A Stub object or the original value being dumped
getStub()
private
getStub(mixed $item) : mixed
Parameters
- $item : mixed