Documentation

Data
in package
implements ArrayAccess, Countable, IteratorAggregate

Tags
author

Nicolas Grekas p@tchwork.com

Interfaces, Classes and Traits

ArrayAccess
Countable
IteratorAggregate

Table of Contents

$data  : mixed
$key  : mixed
$maxDepth  : mixed
$maxItemsPerDepth  : mixed
$position  : mixed
$useRefHandles  : mixed
__construct()  : mixed
__get()  : mixed
__isset()  : mixed
__toString()  : mixed
count()  : mixed
dump()  : mixed
Dumps data with a DumperInterface dumper.
getIterator()  : mixed
getRawData()  : array<string|int, mixed>
getType()  : string|null
getValue()  : string|int|float|bool|array<string|int, mixed>|array<string|int, Data>|null
offsetExists()  : mixed
offsetGet()  : mixed
offsetSet()  : mixed
offsetUnset()  : mixed
seek()  : static|null
Seeks to a specific key in nested data structures.
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

$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(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

__isset()

public __isset(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

__toString()

public __toString() : mixed
Return values
mixed

count()

public count() : mixed
Return values
mixed

getIterator()

public getIterator() : mixed
Return values
mixed

getRawData()

public getRawData() : array<string|int, mixed>
Tags
deprecated

since version 3.3. Use array or object access instead.

Return values
array<string|int, mixed>

The raw data structure

getType()

public getType() : string|null
Return values
string|null

The type of the value

getValue()

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

A native representation of the original value

offsetExists()

public offsetExists(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

offsetGet()

public offsetGet(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

offsetSet()

public offsetSet(mixed $key, mixed $value) : mixed
Parameters
$key : mixed
$value : mixed
Return values
mixed

offsetUnset()

public offsetUnset(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

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

Null if the key is not set

withMaxDepth()

Returns a depth limited clone of $this.

public withMaxDepth(int $maxDepth) : static
Parameters
$maxDepth : int

The max dumped depth level

Return values
static

withMaxItemsPerDepth()

Limits the number of elements per depth level.

public withMaxItemsPerDepth(int $maxItemsPerDepth) : static
Parameters
$maxItemsPerDepth : int

The max number of items dumped per depth level

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, string $hashType, bool $dumpKeys) : int
Parameters
$dumper : DumperInterface
$parentCursor : Cursor

The cursor of the parent hash

$refs : array<string|int, mixed>

A map of all references discovered while dumping

$children : array<string|int, mixed>

The children to dump

$hashCut : int

The number of items removed from the original hash

$hashType : string

A Cursor::HASH_* const

$dumpKeys : bool

Whether keys should be dumped or not

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

The dumper being used for dumping

$cursor : Cursor

A cursor used for tracking dumper state position

$refs : array<string|int, mixed>

A map of all references discovered while dumping

$item : mixed

A Stub object or the original value being dumped

Return values
mixed

getStub()

private getStub(mixed $item) : mixed
Parameters
$item : mixed
Return values
mixed

Search results