PHP 클래스 Swift_DependencyContainer, Halite

저자: Chris Corbyn
파일 보기 프로젝트 열기: HaliteChallenge/Halite 1 사용 예제들

공개 메소드들

메소드 설명
__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