PHP Class Papi_Container, papi

Inheritance: implements ArrayAccess
Afficher le fichier Open project: wp-papi/papi

Protected Properties

Свойство Type Description
$classes array The classes holder.
$keys array The keys holder.
$values array The values holder.

Méthodes publiques

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

Méthodes protégées

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

Method Details

bind() public méthode

Set a parameter or an object.
public bind ( string $id, mixed $value = null, boolean $singleton = false ) : mixed
$id string
$value mixed
$singleton boolean
Résultat mixed

call_closure() protected méthode

Call closure.
protected call_closure ( mixed $closure, array $parameters = [] ) : Closure
$closure mixed
$parameters array
Résultat Closure

exists() public méthode

Check if identifier is set or not.
public exists ( string $id ) : boolean
$id string
Résultat boolean

get_class_prefix() protected méthode

Get class prefix.
protected get_class_prefix ( string $id, boolean $check = true ) : string
$id string
$check boolean
Résultat string

get_closure() protected méthode

Get closure function.
protected get_closure ( mixed $value, boolean $singleton = false ) : Closure
$value mixed
$singleton boolean
Résultat Closure

is_singleton() public méthode

Determine if a given type is a singleton or not.
public is_singleton ( string $id ) : boolean
$id string
Résultat boolean

make() public méthode

Resolve the given type from the container.
public make ( string $id, array $parameters = [] ) : Closure
$id string
$parameters array
Résultat Closure

offsetExists() public méthode

Check if identifier is set or not.
public offsetExists ( string $id ) : boolean
$id string
Résultat boolean

offsetGet() public méthode

Get value by identifier.
public offsetGet ( string $id ) : mixed
$id string
Résultat mixed

offsetSet() public méthode

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

offsetUnset() public méthode

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

once() public méthode

Add key and value to the container once.
public once ( string $key, mixed $callback ) : mixed
$key string
$callback mixed
Résultat mixed

remove() public méthode

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

reset() public méthode

Reset container values.
public reset ( )

singleton() public méthode

Set a parameter or an object.
public singleton ( string $id, mixed $value = null ) : mixed
$id string
$value mixed
Résultat mixed

Property Details

$classes protected_oe property

The classes holder.
protected array $classes
Résultat array

$keys protected_oe property

The keys holder.
protected array $keys
Résultat array

$values protected_oe property

The values holder.
protected array $values
Résultat array