class Service implements ServiceInterface

服务原型

容器中对单个服务单元的定义

Methods

__construct(string $id, object|string|array $definition, bool $shared = true)

Service constructor.

bool
isShared()

服务是否为共享的

mixed
resolve(array $parameters = [], ContainerInterface $container = null)

解析服务

Details

at line 61
__construct(string $id, object|string|array $definition, bool $shared = true)

Service constructor.

Parameters

string $id 服务标识
object|string|array $definition
bool $shared

at line 73
bool isShared()

服务是否为共享的

Return Value

bool

at line 86
mixed resolve(array $parameters = [], ContainerInterface $container = null)

解析服务

Parameters

array $parameters 参数
ContainerInterface $container 容器对象实例

Return Value

mixed

Exceptions

Exception