InlineServiceConfigurator
extends AbstractConfigurator
in package
Uses
ArgumentTrait, AutowireTrait, BindTrait, CallTrait, ConfiguratorTrait, FactoryTrait, FileTrait, LazyTrait, ParentTrait, PropertyTrait, TagTrait
Tags
Table of Contents
- FACTORY = 'service'
- $valuePreProcessor : callable
- $allowParent : mixed
- $id : mixed
- $path : mixed
- __call() : mixed
- __construct() : mixed
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- arg() : $this
- Sets one argument to pass to the service constructor/factory method.
- args() : $this
- Sets the arguments to pass to the service constructor/factory method.
- autowire() : $this
- Enables/disables autowiring.
- bind() : $this
- Sets bindings.
- call() : $this
- Adds a method to call after service initialization.
- configurator() : $this
- Sets a configurator to call after the service is fully initialized.
- factory() : $this
- Sets a factory.
- file() : $this
- Sets a file to require before creating the service.
- lazy() : $this
- Sets the lazy flag of this service.
- parent() : $this
- Sets the Definition to inherit from.
- processValue() : mixed
- Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
- property() : $this
- Sets a specific property.
- tag() : $this
- Adds a tag for this definition.
Constants
FACTORY
public
mixed
FACTORY
= 'service'
Properties
$valuePreProcessor
public
static callable
$valuePreProcessor
(mixed, bool)|null
$allowParent
private
mixed
$allowParent
= true
$id
private
mixed
$id
= '[inline]'
$path
private
mixed
$path
= null
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(Definition $definition) : mixed
Parameters
- $definition : Definition
Return values
mixed —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__wakeup()
public
__wakeup() : mixed
Return values
mixed —arg()
Sets one argument to pass to the service constructor/factory method.
public
final arg(string|int $key, mixed $value) : $this
Parameters
- $key : string|int
- $value : mixed
Return values
$this —args()
Sets the arguments to pass to the service constructor/factory method.
public
final args(array<string|int, mixed> $arguments) : $this
Parameters
- $arguments : array<string|int, mixed>
Return values
$this —autowire()
Enables/disables autowiring.
public
final autowire([bool $autowired = true ]) : $this
Parameters
- $autowired : bool = true
Return values
$this —bind()
Sets bindings.
public
final bind(string $nameOrFqcn, mixed $valueOrRef) : $this
Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions).
Parameters
- $nameOrFqcn : string
-
A parameter name with its "$" prefix, or an FQCN
- $valueOrRef : mixed
-
The value or reference to bind
Return values
$this —call()
Adds a method to call after service initialization.
public
final call(string $method[, array<string|int, mixed> $arguments = [] ][, bool $returnsClone = false ]) : $this
Parameters
- $method : string
-
The method name to call
- $arguments : array<string|int, mixed> = []
-
An array of arguments to pass to the method call
- $returnsClone : bool = false
-
Whether the call returns the service instance or not
Tags
Return values
$this —configurator()
Sets a configurator to call after the service is fully initialized.
public
final configurator(string|array<string|int, mixed> $configurator) : $this
Parameters
- $configurator : string|array<string|int, mixed>
-
A PHP callable reference
Return values
$this —factory()
Sets a factory.
public
final factory(string|array<string|int, mixed>|ReferenceConfigurator $factory) : $this
Parameters
- $factory : string|array<string|int, mixed>|ReferenceConfigurator
-
A PHP callable reference
Return values
$this —file()
Sets a file to require before creating the service.
public
final file(string $file) : $this
Parameters
- $file : string
Return values
$this —lazy()
Sets the lazy flag of this service.
public
final lazy([bool|string $lazy = true ]) : $this
Parameters
- $lazy : bool|string = true
-
A FQCN to derivate the lazy proxy from or
true
to make it extend from the definition's class
Return values
$this —parent()
Sets the Definition to inherit from.
public
final parent(string $parent) : $this
Parameters
- $parent : string
Tags
Return values
$this —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
property()
Sets a specific property.
public
final property(string $name, mixed $value) : $this
Parameters
- $name : string
- $value : mixed
Return values
$this —tag()
Adds a tag for this definition.
public
final tag(string $name[, array<string|int, mixed> $attributes = [] ]) : $this
Parameters
- $name : string
- $attributes : array<string|int, mixed> = []