class Service

Class Service

Methods

__construct($callback, array $arguments = [], bool $shared = false, bool $locked = false)

Service constructor.

__destruct()

__destruct

mixed|null
get(Container $container, bool $forceNew = false)

No description

mixed
getCallback()

No description

setCallback($callback)

No description

array
getArguments()

No description

setArguments(array $params)

给服务设置参数,在获取服务实例前

mixed
getInstance()

No description

bool
isLocked()

No description

setLocked(bool $locked = true)

No description

bool
isShared()

No description

setShared(bool $shared = true)

No description

Details

at line 53
__construct($callback, array $arguments = [], bool $shared = false, bool $locked = false)

Service constructor.

Parameters

$callback
array $arguments
bool $shared
bool $locked

at line 73
__destruct()

__destruct

at line 83
mixed|null get(Container $container, bool $forceNew = false)

Parameters

Container $container
bool $forceNew

Return Value

mixed|null

at line 104
mixed getCallback()

Return Value

mixed

at line 112
setCallback($callback)

Parameters

$callback

at line 128
array getArguments()

Return Value

array

at line 138
setArguments(array $params)

给服务设置参数,在获取服务实例前

Parameters

array $params 设置参数

Exceptions

InvalidArgumentException

at line 146
mixed getInstance()

Return Value

mixed

at line 154
bool isLocked()

Return Value

bool

at line 162
setLocked(bool $locked = true)

Parameters

bool $locked

at line 170
bool isShared()

Return Value

bool

at line 178
setShared(bool $shared = true)

Parameters

bool $shared