PHP Класс nspl\ds\DefaultArray

Наследование: extends ArrayObject
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$default mixed | callable

Открытые методы

Метод Описание
__construct ( mixed | callable $default, array $data = [] ) If you pass a function as default value it will be called without arguments to provide a default value for the given key, this value will be inserted in the array for the key, and returned.
__toString ( ) : string
fromArray ( mixed $default, array $array ) : static
offsetGet ( integer $index ) : mixed (PHP 5 >= 5.0.0)
Offset to retrieve

Приватные методы

Метод Описание
getDefault ( )

Описание методов

__construct() публичный Метод

If you pass a function as default value it will be called without arguments to provide a default value for the given key, this value will be inserted in the array for the key, and returned.
public __construct ( mixed | callable $default, array $data = [] )
$default mixed | callable
$data array Provides initial data

__toString() публичный Метод

public __toString ( ) : string
Результат string

fromArray() публичный статический Метод

public static fromArray ( mixed $default, array $array ) : static
$default mixed
$array array
Результат static

offsetGet() публичный Метод

(PHP 5 >= 5.0.0)
Offset to retrieve
public offsetGet ( integer $index ) : mixed
$index integer

The offset to retrieve.

Результат mixed Can return all value types.

Описание свойств

$default защищенное свойство

protected mixed|callable $default
Результат mixed | callable