PHP Класс Swift_DependencyContainer, Halite

Автор: Chris Corbyn
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( ) Constructor should not be used.
addConstructorLookup ( string $lookup ) : Swift_DependencyContainer Specify a dependency lookup for the constructor of the previously registered item.
addConstructorValue ( mixed $value ) : Swift_DependencyContainer Specify a literal (non looked up) value for the constructor of the previously registered item.
asAliasOf ( string $lookup ) : Swift_DependencyContainer Specify the previously registered item as an alias of another item.
asNewInstanceOf ( string $className ) : Swift_DependencyContainer Specify the previously registered item as a new instance of $className.
asSharedInstanceOf ( string $className ) : Swift_DependencyContainer Specify the previously registered item as a shared instance of $className.
asValue ( mixed $value ) : Swift_DependencyContainer Specify the previously registered item as a literal value.
createDependenciesFor ( string $itemName ) : array Create an array of arguments passed to the constructor of $itemName.
getInstance ( ) : Swift_DependencyContainer Returns a singleton of the DependencyContainer.
has ( string $itemName ) : boolean Test if an item is registered in this container with the given name.
listItems ( ) : array List the names of all items stored in the Container.
lookup ( string $itemName ) : mixed Lookup the item with the given $itemName.
register ( string $itemName ) : Swift_DependencyContainer Register a new dependency with $itemName.
withDependencies ( array $lookups ) : Swift_DependencyContainer Specify a list of injected dependencies for the previously registered item.

Приватные методы

Метод Описание
_createAlias ( $itemName ) Resolve an alias to another item
_createNewInstance ( $itemName ) Create a fresh instance of $itemName
_createSharedInstance ( $itemName ) Create and register a shared instance of $itemName
_getEndPoint ( ) Get the current endpoint in the store
_getValue ( $itemName ) Get the literal value with $itemName
_lookupRecursive ( $item ) Resolve a single dependency with an collections
_resolveArgs ( array $args ) Get an argument list with dependencies resolved

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

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

Use {@link getInstance()} instead.
public __construct ( )

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

Specify a dependency lookup for the constructor of the previously registered item.
public addConstructorLookup ( string $lookup ) : Swift_DependencyContainer
$lookup string
Результат Swift_DependencyContainer

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

Specify a literal (non looked up) value for the constructor of the previously registered item.
public addConstructorValue ( mixed $value ) : Swift_DependencyContainer
$value mixed
Результат Swift_DependencyContainer

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

Specify the previously registered item as an alias of another item.
public asAliasOf ( string $lookup ) : Swift_DependencyContainer
$lookup string
Результат Swift_DependencyContainer

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

{@link register()} must be called before this will work. Any arguments can be set with {@link withDependencies()}, {@link addConstructorValue()} or {@link addConstructorLookup()}.
public asNewInstanceOf ( string $className ) : Swift_DependencyContainer
$className string
Результат Swift_DependencyContainer

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

{@link register()} must be called before this will work.
public asSharedInstanceOf ( string $className ) : Swift_DependencyContainer
$className string
Результат Swift_DependencyContainer

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

{@link register()} must be called before this will work.
public asValue ( mixed $value ) : Swift_DependencyContainer
$value mixed
Результат Swift_DependencyContainer

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

Create an array of arguments passed to the constructor of $itemName.
public createDependenciesFor ( string $itemName ) : array
$itemName string
Результат array

getInstance() публичный статический Метод

Returns a singleton of the DependencyContainer.
public static getInstance ( ) : Swift_DependencyContainer
Результат Swift_DependencyContainer

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

Test if an item is registered in this container with the given name.
См. также: register()
public has ( string $itemName ) : boolean
$itemName string
Результат boolean

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

List the names of all items stored in the Container.
public listItems ( ) : array
Результат array

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

Lookup the item with the given $itemName.
См. также: register()
public lookup ( string $itemName ) : mixed
$itemName string
Результат mixed

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

This method returns the current DependencyContainer instance because it requires the use of the fluid interface to set the specific details for the dependency.
public register ( string $itemName ) : Swift_DependencyContainer
$itemName string
Результат Swift_DependencyContainer

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

This method takes an array of lookup names.
public withDependencies ( array $lookups ) : Swift_DependencyContainer
$lookups array
Результат Swift_DependencyContainer