PHP 클래스 Papi_Container, papi

상속: implements ArrayAccess
파일 보기 프로젝트 열기: wp-papi/papi

보호된 프로퍼티들

프로퍼티 타입 설명
$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