class Arraydotify implements ArrayAccess (View source)

Methods

__construct(array $items = [])

Arraydotify constructor.

static Arraydotify
make(array $items = [])

Make array dotify (static factory method)

mixed
offsetGet(mixed $offset)

Get a value from the array using dot notation

bool
offsetExists(mixed $offset)

Check if a key exists in the array using dot notation

void
offsetSet(mixed $offset, mixed $value)

Set a value in the array using dot notation

void
offsetUnset(mixed $offset)

Unset a value from the array using dot notation

array
toArray()

Get the original array

array
getDotified()

Get the dotified array

bool
has(string $key)

Check if the array has a key using dot notation

mixed
get(string $key, mixed $default = null)

Get a value using dot notation with a default fallback

void
set(string $key, mixed $value)

Set a value using dot notation

Details

__construct(array $items = [])

Arraydotify constructor.

Parameters

array $items

static Arraydotify make(array $items = [])

Make array dotify (static factory method)

Parameters

array $items

Return Value

Arraydotify

mixed offsetGet(mixed $offset)

Get a value from the array using dot notation

Parameters

mixed $offset

Return Value

mixed

bool offsetExists(mixed $offset)

Check if a key exists in the array using dot notation

Parameters

mixed $offset

Return Value

bool

void offsetSet(mixed $offset, mixed $value)

Set a value in the array using dot notation

Parameters

mixed $offset
mixed $value

Return Value

void

void offsetUnset(mixed $offset)

Unset a value from the array using dot notation

Parameters

mixed $offset

Return Value

void

array toArray()

Get the original array

Return Value

array

array getDotified()

Get the dotified array

Return Value

array

bool has(string $key)

Check if the array has a key using dot notation

Parameters

string $key

Return Value

bool

mixed get(string $key, mixed $default = null)

Get a value using dot notation with a default fallback

Parameters

string $key
mixed $default

Return Value

mixed

void set(string $key, mixed $value)

Set a value using dot notation

Parameters

string $key
mixed $value

Return Value

void