PHP 클래스 Kahlan\Box\Box

파일 보기 프로젝트 열기: crysalead/kahlan

보호된 프로퍼티들

프로퍼티 타입 설명
$_classes array Class dependencies.
$_definitions array The defined dependency definitions

공개 메소드들

메소드 설명
__construct ( array $config = [] ) The Constructor.
clear ( ) Clears all dependency definitions.
factory ( $name, string | Closur\Closure $definition ) Defining a factory.
get ( string $name ) : mixed Gets a shared variable or an new instance.
has ( $name ) : boolean Checks if a dependency definition exists.
remove ( string $name ) Removes a dependency definition.
service ( $name, mixed $definition ) Defining a service (i.e. singleton).
wrap ( string $name ) : mixed Returns a dependency container.

보호된 메소드들

메소드 설명
_factory ( mixed $definition, array $params ) : mixed Process a setted definition.
_service ( string $name, mixed $definition, array $params ) : mixed Process a shared definition.
_set ( $name, mixed $definition, mixed $type ) Stores a dependency definition.

메소드 상세

__construct() 공개 메소드

The Constructor.
public __construct ( array $config = [] )
$config array The instance configuration. Possible values: - `'wrapper'` _string_: the the wrapper class name to use.

_factory() 보호된 메소드

Process a setted definition.
protected _factory ( mixed $definition, array $params ) : mixed
$definition mixed A definition.
$params array Parameters to pass to the definition.
리턴 mixed

_service() 보호된 메소드

Process a shared definition.
protected _service ( string $name, mixed $definition, array $params ) : mixed
$name string The name of the definition.
$definition mixed A definition.
$params array Parameters to pass to the definition.
리턴 mixed

_set() 보호된 메소드

Stores a dependency definition.
protected _set ( $name, mixed $definition, mixed $type )
$definition mixed The definition.
$type mixed The type of the definition.

clear() 공개 메소드

Clears all dependency definitions.
public clear ( )

factory() 공개 메소드

Defining a factory.
public factory ( $name, string | Closur\Closure $definition )
$definition string | Closur\Closure A fully namespaced classname or a closure.

get() 공개 메소드

Gets a shared variable or an new instance.
public get ( string $name ) : mixed
$name string The name of the definition.
리턴 mixed The shared variable or an new instance.

has() 공개 메소드

Checks if a dependency definition exists.
public has ( $name ) : boolean
리턴 boolean

remove() 공개 메소드

Removes a dependency definition.
public remove ( string $name )
$name string The name of the definition to remove.

service() 공개 메소드

Defining a service (i.e. singleton).
public service ( $name, mixed $definition )
$definition mixed The variable to share.

wrap() 공개 메소드

Returns a dependency container.
public wrap ( string $name ) : mixed
$name string The name of the definition.
리턴 mixed The shared variable or an new instance.

프로퍼티 상세

$_classes 보호되어 있는 프로퍼티

Class dependencies.
protected array $_classes
리턴 array

$_definitions 보호되어 있는 프로퍼티

The defined dependency definitions
protected array $_definitions
리턴 array