PHP Класс Kahlan\Box\Box

Показать файл Открыть проект

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

Свойство Тип Описание
$_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