PHP Class nspl\ds\DefaultArray

Inheritance: extends ArrayObject
Afficher le fichier Open project: ihor/Nspl

Protected Properties

Свойство Type Description
$default mixed | callable

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
getDefault ( )

Method Details

__construct() public méthode

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 méthode

public __toString ( ) : string
Résultat string

fromArray() public static méthode

public static fromArray ( mixed $default, array $array ) : static
$default mixed
$array array
Résultat static

offsetGet() public méthode

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

The offset to retrieve.

Résultat mixed Can return all value types.

Property Details

$default protected_oe property

protected mixed|callable $default
Résultat mixed | callable