class Pointer extends Alvine implements Iterator

Pointer

Properties

protected URI|null $uri
protected array $path
protected integer $escapedCharacterMap

Methods

__construct(string $pointer)

Neuer Pointer

array
build()

No description

string
__toString()

No description

array
parse(string $pathString)

No description

string
encodePart(string $path)

No description

mixed
getValue(array $array)

Gibt den Wert in dem übergebenen Array zurück

array
setValue(array $array, mixed $value)

Setzt den Wert in dem übergebenen Array auf einen Wert

array
removeValue(array $array)

Den Wert am Pointer entfernen

type
getValueOrDefault(array $array, type $default = null)

No description

string
decodePart(string $path)

No description

mixed
current()

No description

scalar
key()

No description

void
next()

No description

void
rewind()

No description

bool
valid()

No description

Details

at line 57
__construct(string $pointer)

Neuer Pointer

Parameters

string $pointer

at line 77
protected array build()

Return Value

array

at line 88
string __toString()

Return Value

string

at line 99
protected array parse(string $pathString)

Parameters

string $pathString

Return Value

array

at line 118
protected string encodePart(string $path)

Parameters

string $path

Return Value

string

at line 146
mixed getValue(array $array)

Gibt den Wert in dem übergebenen Array zurück

$doc=(new \Alvine\Json\Decoder)->decode('{"a":{"b":{"c":{"d":1}}}}');
echo (new \Alvine\Json\Pointer('/a/b/c/d'))->getValue($doc);
// -> 1

Parameters

array $array

Return Value

mixed

Exceptions

NotFoundException
WrongTypeException

at line 188
array setValue(array $array, mixed $value)

Setzt den Wert in dem übergebenen Array auf einen Wert

$doc=(new \Alvine\Json\Decoder)->decode('{"a":{"b":{"c":{"d":1}}}}');
$result = (new \Alvine\Json\Pointer('/a/b/c/d'))->setValue($doc, 3);
// $result -> {"a":{"b":{"c":{"d":3}}}}

Parameters

array $array
mixed $value

Return Value

array Geändertes Dokument

Exceptions

WrongTypeException

at line 262
array removeValue(array $array)

Den Wert am Pointer entfernen

$doc=(new \Alvine\Json\Decoder)->decode('{"a":{"b":{"c":{"d":1}}}}');
$result = (new \Alvine\Json\Pointer('/a/b/c/d'))->setValue($doc, 3);
// $result -> {"a":{"b":{"c":{"d":3}}}}

Parameters

array $array

Return Value

array Geändertes Dokument

Exceptions

WrongTypeException

at line 303
type getValueOrDefault(array $array, type $default = null)

Parameters

array $array
type $default

Return Value

type

at line 317
protected string decodePart(string $path)

Parameters

string $path

Return Value

string

at line 325
mixed current()

Return Value

mixed

at line 334
scalar key()

Return Value

scalar

at line 342
void next()

Return Value

void

at line 350
void rewind()

Return Value

void

at line 358
bool valid()

Return Value

bool