PHP 클래스 PhpSpec\ServiceContainer\IndexedServiceContainer

상속: implements PhpSpec\ServiceContainer
파일 보기 프로젝트 열기: phpspec/phpspec 1 사용 예제들

공개 메소드들

메소드 설명
addConfigurator ( callable $configurator ) Adds a configurator, that can configure many services in one value
configure ( ) Loop through all configurators and invoke them
define ( string $id, callable $definition, array $tags = [] ) Sets a factory for the service creation. The same service will be returned every time
get ( string $id ) : object Retrieves a service from the container
getByTag ( string $tag ) : array Finds all services tagged with a particular string
getParam ( string $id, mixed $default = null ) : mixed Gets a param from the container or a default value.
has ( string $id ) : boolean Determines whether a service is defined
remove ( string $id ) Removes a service from the container
set ( string $id, object $service, array $tags = [] ) Sets a object to be used as a service
setParam ( string $id, mixed $value ) Sets a param in the container

비공개 메소드들

메소드 설명
indexTags ( string $id, array $tags ) Adds a service or service definition to the index

메소드 상세

addConfigurator() 공개 메소드

Adds a configurator, that can configure many services in one value
public addConfigurator ( callable $configurator )
$configurator callable

configure() 공개 메소드

Loop through all configurators and invoke them
public configure ( )

define() 공개 메소드

Sets a factory for the service creation. The same service will be returned every time
public define ( string $id, callable $definition, array $tags = [] )
$id string
$definition callable
$tags array

get() 공개 메소드

Retrieves a service from the container
public get ( string $id ) : object
$id string
리턴 object

getByTag() 공개 메소드

Finds all services tagged with a particular string
public getByTag ( string $tag ) : array
$tag string
리턴 array

getParam() 공개 메소드

Gets a param from the container or a default value.
public getParam ( string $id, mixed $default = null ) : mixed
$id string
$default mixed
리턴 mixed

has() 공개 메소드

Determines whether a service is defined
public has ( string $id ) : boolean
$id string
리턴 boolean

remove() 공개 메소드

Removes a service from the container
public remove ( string $id )
$id string

set() 공개 메소드

Sets a object to be used as a service
public set ( string $id, object $service, array $tags = [] )
$id string
$service object
$tags array

setParam() 공개 메소드

Sets a param in the container
public setParam ( string $id, mixed $value )
$id string
$value mixed