PHP 클래스 Coduo\TuTu\ServiceContainer

파일 보기 프로젝트 열기: coduo/tutu 1 사용 예제들

공개 메소드들

메소드 설명
getParameter ( $id ) : mixed
getService ( $id ) : mixed
getServicesByTag ( $tag ) : array
hasParameter ( $id ) : boolean
hasService ( $id ) : boolean
removeService ( $id )
setDefinition ( $id, Closure $definition, array $tags = [] ) getService($id) will return result of $definition closure.
setParameter ( $id, $value )
setStaticDefinition ( $id, Closure $definition, array $tags = [] ) Works just like setDefinition but getService($id) is going to return exactly same value every single time.

메소드 상세

getParameter() 공개 메소드

public getParameter ( $id ) : mixed
$id
리턴 mixed

getService() 공개 메소드

public getService ( $id ) : mixed
$id
리턴 mixed

getServicesByTag() 공개 메소드

public getServicesByTag ( $tag ) : array
$tag
리턴 array

hasParameter() 공개 메소드

public hasParameter ( $id ) : boolean
$id
리턴 boolean

hasService() 공개 메소드

public hasService ( $id ) : boolean
$id
리턴 boolean

removeService() 공개 메소드

public removeService ( $id )

setDefinition() 공개 메소드

Callback will be executed with $this (ServiceContainer) as a argument.
public setDefinition ( $id, Closure $definition, array $tags = [] )
$id
$definition Closure
$tags array

setParameter() 공개 메소드

public setParameter ( $id, $value )
$id
$value

setStaticDefinition() 공개 메소드

Works just like setDefinition but getService($id) is going to return exactly same value every single time.
public setStaticDefinition ( $id, Closure $definition, array $tags = [] )
$id
$definition Closure
$tags array