| Methods |
public
|
__construct(ParameterBagInterface $parameterBag = null)
|
#
|
public
|
compile(): void
Compiles the container.
Compiles the container.
This method does two things:
- Parameter values are resolved;
- The parameter bag is frozen.
Overriden by
|
#
|
public
|
isCompiled(): bool
Returns true if the container is compiled.
Returns true if the container is compiled.
|
#
|
public
|
getParameterBag(): ParameterBagInterface
Gets the service container parameter bag.
Gets the service container parameter bag.
|
#
|
public
|
getParameter(string $name): array|bool|string|int|float|UnitEnum|null
Gets a parameter.
|
#
|
public
|
hasParameter(string $name): bool
|
#
|
public
|
setParameter(string $name, array|bool|string|int|float|UnitEnum|null $value): void
|
#
|
public
|
set(string $id, ?object $service): void
Sets a service.
Sets a service.
Setting a synthetic service to null resets it: has() returns false and get()
behaves in the same way as if the service was never created.
Overriden by
Implements
|
#
|
public
|
has(string $id): bool
Returns true if the container can return an entry for the given identifier.
Returns false otherwise.
Returns true if the container can return an entry for the given identifier.
Returns false otherwise.
has($id) returning true does not mean that get($id) will not throw an exception.
It does however mean that get($id) will not throw a NotFoundExceptionInterface.
Parameters
| $id |
Identifier of the entry to look for.
|
Overriden by
Implements
|
#
|
public
|
get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE): ?object
Gets a service.
Parameters
| $id |
Identifier of the entry to look for.
|
Returns
Throws
Overriden by
Implements
|
#
|
private
static
|
make(self $container, string $id, int $invalidBehavior): ?object
Creates a service.
Creates a service.
As a separate method to allow "get()" to use the really fast ?? operator.
|
#
|
public
|
initialized(string $id): bool
Returns true if the given service has actually been initialized.
Returns true if the given service has actually been initialized.
Implements
|
#
|
public
|
reset(): void
|
#
|
public
|
getServiceIds(): string[]
Gets all service ids.
|
#
|
public
|
getRemovedIds(): array
Gets service ids that existed at compile time.
Gets service ids that existed at compile time.
Overriden by
|
#
|
public
static
|
camelize(string $id): string
Camelizes a string.
|
#
|
public
static
|
underscore(string $id): string
A string to underscore.
|
#
|
protected
|
load(string $file): mixed
Creates a service by requiring its factory file.
Creates a service by requiring its factory file.
|
#
|
protected
|
getEnv(string $name): mixed
Fetches a variable from the environment.
Fetches a variable from the environment.
Throws
Overriden by
|
#
|
private
|
__clone()
|
#
|