ServicesConfigurator
extends AbstractConfigurator
in package
Tags
Table of Contents
- FACTORY = 'services'
- $valuePreProcessor : callable
- $anonymousCount : mixed
- $anonymousHash : mixed
- $container : mixed
- $defaults : mixed
- $instanceof : mixed
- $loader : mixed
- $path : mixed
- __call() : mixed
- __construct() : mixed
- __destruct() : mixed
- __invoke() : ServiceConfigurator
- Registers a service.
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- alias() : AliasConfigurator
- Creates an alias.
- defaults() : DefaultsConfigurator
- Defines a set of defaults for following service definitions.
- get() : ServiceConfigurator
- Gets an already defined service definition.
- instanceof() : InstanceofConfigurator
- Defines an instanceof-conditional to be applied to following service definitions.
- load() : PrototypeConfigurator
- Registers a PSR-4 namespace using a glob pattern.
- processValue() : mixed
- Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
- remove() : $this
- Removes an already defined service definition or alias.
- set() : ServiceConfigurator
- Registers a service.
- stack() : AliasConfigurator
- Registers a stack of decorator services.
Constants
FACTORY
public
mixed
FACTORY
= 'services'
Properties
$valuePreProcessor
public
static callable
$valuePreProcessor
(mixed, bool)|null
$anonymousCount
private
mixed
$anonymousCount
$anonymousHash
private
mixed
$anonymousHash
$container
private
mixed
$container
$defaults
private
mixed
$defaults
$instanceof
private
mixed
$instanceof
$loader
private
mixed
$loader
$path
private
mixed
$path
Methods
__call()
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
Return values
mixed —__construct()
public
__construct(ContainerBuilder $container, PhpFileLoader $loader, array<string|int, mixed> &$instanceof[, string|null $path = null ], int &$anonymousCount) : mixed
Parameters
- $container : ContainerBuilder
- $loader : PhpFileLoader
- $instanceof : array<string|int, mixed>
- $path : string|null = null
- $anonymousCount : int
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —__invoke()
Registers a service.
public
final __invoke(string $id[, string|null $class = null ]) : ServiceConfigurator
Parameters
- $id : string
- $class : string|null = null
Return values
ServiceConfigurator —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__wakeup()
public
__wakeup() : mixed
Return values
mixed —alias()
Creates an alias.
public
final alias(string $id, string $referencedId) : AliasConfigurator
Parameters
- $id : string
- $referencedId : string
Return values
AliasConfigurator —defaults()
Defines a set of defaults for following service definitions.
public
final defaults() : DefaultsConfigurator
Return values
DefaultsConfigurator —get()
Gets an already defined service definition.
public
final get(string $id) : ServiceConfigurator
Parameters
- $id : string
Tags
Return values
ServiceConfigurator —instanceof()
Defines an instanceof-conditional to be applied to following service definitions.
public
final instanceof(string $fqcn) : InstanceofConfigurator
Parameters
- $fqcn : string
Return values
InstanceofConfigurator —load()
Registers a PSR-4 namespace using a glob pattern.
public
final load(string $namespace, string $resource) : PrototypeConfigurator
Parameters
- $namespace : string
- $resource : string
Return values
PrototypeConfigurator —processValue()
Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
public
static processValue(mixed $value[, bool $allowServices = false ]) : mixed
Parameters
- $value : mixed
- $allowServices : bool = false
-
whether Definition and Reference are allowed; by default, only scalars and arrays are
Return values
mixed —the value, optionally cast to a Definition/Reference
remove()
Removes an already defined service definition or alias.
public
final remove(string $id) : $this
Parameters
- $id : string
Return values
$this —set()
Registers a service.
public
final set(string|null $id[, string|null $class = null ]) : ServiceConfigurator
Parameters
- $id : string|null
-
The service id, or null to create an anonymous service
- $class : string|null = null
-
The class of the service, or null when $id is also the class name
Return values
ServiceConfigurator —stack()
Registers a stack of decorator services.
public
final stack(string $id, array<string|int, InlineServiceConfigurator>|array<string|int, ReferenceConfigurator> $services) : AliasConfigurator
Parameters
- $id : string
- $services : array<string|int, InlineServiceConfigurator>|array<string|int, ReferenceConfigurator>