Data
in package
implements
ArrayAccess, Countable, IteratorAggregate
Tags
Interfaces, Classes and Traits
- ArrayAccess
- Countable
- IteratorAggregate
Table of Contents
- $context : mixed
- $data : mixed
- $key : mixed
- $maxDepth : mixed
- $maxItemsPerDepth : mixed
- $position : mixed
- $useRefHandles : mixed
- __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
mixed
$context
= []
$data
private
mixed
$data
$key
private
mixed
$key
= 0
$maxDepth
private
mixed
$maxDepth
= 20
$maxItemsPerDepth
private
mixed
$maxItemsPerDepth
= -1
$position
private
mixed
$position
= 0
$useRefHandles
private
mixed
$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()
Return values
mixed —__get()
public
__get(string $key) : mixed
Parameters
- $key : string
Return values
mixed —__isset()
public
__isset(string $key) : bool
Parameters
- $key : string
Return values
bool —__toString()
public
__toString() : string
Return values
string —count()
public
count() : int
Return values
int —dump()
Dumps data with a DumperInterface dumper.
public
dump(DumperInterface $dumper) : mixed
Parameters
- $dumper : DumperInterface
Return values
mixed —getIterator()
public
getIterator() : Traversable
Return values
Traversable —getType()
public
getType() : string|null
Return values
string|null —getValue()
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>|null —offsetExists()
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —offsetGet()
public
offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —offsetSet()
public
offsetSet(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
Return values
void —offsetUnset()
public
offsetUnset(mixed $key) : void
Parameters
- $key : mixed
Return values
void —seek()
Seeks to a specific key in nested data structures.
public
seek(string|int $key) : static|null
Parameters
- $key : string|int
-
The key to seek to
Return values
static|null —withContext()
public
withContext(array<string|int, mixed> $context) : static
Parameters
- $context : array<string|int, mixed>
Return values
static —withMaxDepth()
Returns a depth limited clone of $this.
public
withMaxDepth(int $maxDepth) : static
Parameters
- $maxDepth : int
Return values
static —withMaxItemsPerDepth()
Limits the number of elements per depth level.
public
withMaxItemsPerDepth(int $maxItemsPerDepth) : static
Parameters
- $maxItemsPerDepth : int
Return values
static —withRefHandles()
Enables/disables objects' identifiers tracking.
public
withRefHandles(bool $useRefHandles) : static
Parameters
- $useRefHandles : bool
-
False to hide global ref. handles
Return values
static —dumpChildren()
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
Return values
mixed —getStub()
private
getStub(mixed $item) : mixed
Parameters
- $item : mixed