Documentation

Data
in package
implements DataInterface, ArrayAccess

Tags
implements

Table of Contents

Interfaces

DataInterface
ArrayAccess

Constants

DELIMITERS  = ['.', '/']

Properties

$data  : array<string, mixed>
Internal representation of data data

Methods

__construct()  : mixed
Constructor
append()  : void
Append a value to a key (assumes key refers to an array value)
export()  : array<string, mixed>
Export data as raw data
get()  : mixed
Get the raw value for a key
getData()  : DataInterface
Get a data instance for a key
has()  : bool
Check if the key exists
import()  : void
Import data into existing data
importData()  : void
Import data from an external data into existing data
offsetExists()  : bool
{@inheritdoc}
offsetGet()  : mixed
{@inheritdoc}
offsetSet()  : void
{@inheritdoc}
offsetUnset()  : void
{@inheritdoc}
remove()  : void
Remove a key
set()  : void
Set a value for a key
formatPath()  : string
keyToPathArray()  : array<string|int, string>

Constants

DELIMITERS

private mixed DELIMITERS = ['.', '/']

Properties

$data

Internal representation of data data

protected array<string, mixed> $data

Methods

__construct()

Constructor

public __construct([array<string, mixed> $data = [] ]) : mixed
Parameters
$data : array<string, mixed> = []

append()

Append a value to a key (assumes key refers to an array value)

public append(string $key[, mixed $value = null ]) : void
Parameters
$key : string
$value : mixed = null

export()

Export data as raw data

public export() : array<string, mixed>
Tags
psalm-mutation-free
Return values
array<string, mixed>

get()

Get the raw value for a key

public get(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Tags
psalm-mutation-free

getData()

Get a data instance for a key

public getData(string $key) : DataInterface
Parameters
$key : string
Tags
psalm-mutation-free
Return values
DataInterface

has()

Check if the key exists

public has(string $key) : bool
Parameters
$key : string
Tags
psalm-mutation-free
Return values
bool

import()

Import data into existing data

public import(array<string|int, mixed> $data[, int $mode = self::REPLACE ]) : void
Parameters
$data : array<string|int, mixed>
$mode : int = self::REPLACE

importData()

Import data from an external data into existing data

public importData(DataInterface $data[, int $mode = self::REPLACE ]) : void
Parameters
$data : DataInterface
$mode : int = self::REPLACE

offsetExists()

{@inheritdoc}

public offsetExists(mixed $key) : bool
Parameters
$key : mixed
Attributes
#[ReturnTypeWillChange]
Return values
bool

offsetGet()

{@inheritdoc}

public offsetGet(mixed $key) : mixed
Parameters
$key : mixed
Attributes
#[ReturnTypeWillChange]

offsetSet()

{@inheritdoc}

public offsetSet(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
Attributes
#[ReturnTypeWillChange]

offsetUnset()

{@inheritdoc}

public offsetUnset(mixed $key) : void
Parameters
$key : mixed
Attributes
#[ReturnTypeWillChange]

remove()

Remove a key

public remove(string $key) : void
Parameters
$key : string

set()

Set a value for a key

public set(string $key[, mixed $value = null ]) : void
Parameters
$key : string
$value : mixed = null

formatPath()

protected static formatPath(string|array<string|int, string> $path) : string
Parameters
$path : string|array<string|int, string>
Tags
psalm-pure
Return values
string

keyToPathArray()

protected static keyToPathArray(string $path) : array<string|int, string>
Parameters
$path : string
Tags
psalm-return

non-empty-list

psalm-pure
Return values
array<string|int, string>

        
On this page

Search results