Methods |
public
|
__construct(array $params = [])
|
#
|
public
|
getParameters(): array
|
#
|
public
|
addService(string $name, object $service): static
Adds the service to the container.
Adds the service to the container.
Parameters
$service |
service or its factory
|
|
#
|
public
|
removeService(string $name): void
Removes the service from the container.
Removes the service from the container.
|
#
|
public
|
getService(string $name): object
Gets the service object by name.
Gets the service object by name.
Throws
|
#
|
public
|
getByName(string $name): object
Gets the service object by name.
Gets the service object by name.
Throws
|
#
|
public
|
getServiceType(string $name): string
Gets the service type by name.
Gets the service type by name.
Throws
|
#
|
public
|
hasService(string $name): bool
|
#
|
public
|
isCreated(string $name): bool
|
#
|
public
|
createService(string $name, array $args = []): object
Creates new instance of the service.
Creates new instance of the service.
Throws
|
#
|
public
|
getByType<T is object>(class-string<T> $type, bool $throw = true): ?T
Resolves service by type.
Resolves service by type.
Throws
|
#
|
public
|
findByType(string $type): string[]
Gets the service names of the specified type.
Gets the service names of the specified type.
|
#
|
public
|
findByTag(string $tag): array
Gets the service names of the specified tag.
Gets the service names of the specified tag.
Returns
of [service name => tag attributes]
|
#
|
public
|
createInstance(string $class, array $args = []): object
Creates new instance using autowiring.
Creates new instance using autowiring.
Throws
|
#
|
public
|
callInjects(object $service): void
Calls all methods starting with with "inject" using autowiring.
Calls all methods starting with with "inject" using autowiring.
|
#
|
public
|
callMethod(callable $function, array $args = []): mixed
Calls method using autowiring.
Calls method using autowiring.
|
#
|
public
static
|
getMethodName(string $name): string
|
#
|