PHP Класс Papi_Container, papi

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

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

Свойство Тип Описание
$classes array The classes holder.
$keys array The keys holder.
$values array The values holder.

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

Метод Описание
bind ( string $id, mixed $value = null, boolean $singleton = false ) : mixed Set a parameter or an object.
exists ( string $id ) : boolean Check if identifier is set or not.
is_singleton ( string $id ) : boolean Determine if a given type is a singleton or not.
make ( string $id, array $parameters = [] ) : Closure Resolve the given type from the container.
offsetExists ( string $id ) : boolean Check if identifier is set or not.
offsetGet ( string $id ) : mixed Get value by identifier.
offsetSet ( string $id, mixed $value ) Set a parameter or an object.
offsetUnset ( string $id ) Unset value by identifier.
once ( string $key, mixed $callback ) : mixed Add key and value to the container once.
remove ( string $id ) Unset value by identifier.
reset ( ) Reset container values.
singleton ( string $id, mixed $value = null ) : mixed Set a parameter or an object.

Защищенные методы

Метод Описание
call_closure ( mixed $closure, array $parameters = [] ) : Closure Call closure.
get_class_prefix ( string $id, boolean $check = true ) : string Get class prefix.
get_closure ( mixed $value, boolean $singleton = false ) : Closure Get closure function.

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

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

Set a parameter or an object.
public bind ( string $id, mixed $value = null, boolean $singleton = false ) : mixed
$id string
$value mixed
$singleton boolean
Результат mixed

call_closure() защищенный Метод

Call closure.
protected call_closure ( mixed $closure, array $parameters = [] ) : Closure
$closure mixed
$parameters array
Результат Closure

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

Check if identifier is set or not.
public exists ( string $id ) : boolean
$id string
Результат boolean

get_class_prefix() защищенный Метод

Get class prefix.
protected get_class_prefix ( string $id, boolean $check = true ) : string
$id string
$check boolean
Результат string

get_closure() защищенный Метод

Get closure function.
protected get_closure ( mixed $value, boolean $singleton = false ) : Closure
$value mixed
$singleton boolean
Результат Closure

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

Determine if a given type is a singleton or not.
public is_singleton ( string $id ) : boolean
$id string
Результат boolean

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

Resolve the given type from the container.
public make ( string $id, array $parameters = [] ) : Closure
$id string
$parameters array
Результат Closure

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

Check if identifier is set or not.
public offsetExists ( string $id ) : boolean
$id string
Результат boolean

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

Get value by identifier.
public offsetGet ( string $id ) : mixed
$id string
Результат mixed

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

Set a parameter or an object.
public offsetSet ( string $id, mixed $value )
$id string
$value mixed

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

Unset value by identifier.
public offsetUnset ( string $id )
$id string

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

Add key and value to the container once.
public once ( string $key, mixed $callback ) : mixed
$key string
$callback mixed
Результат mixed

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

Unset value by identifier.
public remove ( string $id )
$id string

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

Reset container values.
public reset ( )

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

Set a parameter or an object.
public singleton ( string $id, mixed $value = null ) : mixed
$id string
$value mixed
Результат mixed

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

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

The classes holder.
protected array $classes
Результат array

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

The keys holder.
protected array $keys
Результат array

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

The values holder.
protected array $values
Результат array