InlineServiceConfigurator

class InlineServiceConfigurator extends AbstractConfigurator

Traits

ArgumentTrait
AutowireTrait
BindTrait
FactoryTrait
FileTrait
LazyTrait
ParentTrait
TagTrait

Constants

FACTORY

Methods

__call($method, $args) from AbstractConfigurator
static mixed processValue(mixed $value, bool $allowServices = false)

Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.

from AbstractConfigurator
$this args(array $arguments)

Sets the arguments to pass to the service constructor/factory method.

from ArgumentTrait
$this arg(string|int $key, mixed $value)

Sets one argument to pass to the service constructor/factory method.

from ArgumentTrait
$this autowire(bool $autowired = true)

Enables/disables autowiring.

from AutowireTrait
$this bind(string $nameOrFqcn, mixed $valueOrRef)

Sets bindings.

from BindTrait
$this factory(string|array $factory)

Sets a factory.

from FactoryTrait
$this file(string $file)

Sets a file to require before creating the service.

from FileTrait
$this lazy(bool $lazy = true)

Sets the lazy flag of this service.

from LazyTrait
$this tag(string $name, array $attributes = array())

Adds a tag for this definition.

from TagTrait
__construct(Definition $definition)

Details

__call($method, $args)

Parameters

$method
$args

static mixed processValue(mixed $value, bool $allowServices = false)

Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.

Parameters

mixed $value
bool $allowServices whether Definition and Reference are allowed; by default, only scalars and arrays are

Return Value

mixed the value, optionaly cast to a Definition/Reference

final $this args(array $arguments)

Sets the arguments to pass to the service constructor/factory method.

Parameters

array $arguments An array of arguments

Return Value

$this

final $this arg(string|int $key, mixed $value)

Sets one argument to pass to the service constructor/factory method.

Parameters

string|int $key
mixed $value

Return Value

$this

final $this autowire(bool $autowired = true)

Enables/disables autowiring.

Parameters

bool $autowired

Return Value

$this

final $this bind(string $nameOrFqcn, mixed $valueOrRef)

Sets bindings.

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

string $nameOrFqcn A parameter name with its "$" prefix, or a FQCN
mixed $valueOrRef The value or reference to bind

Return Value

$this

final $this factory(string|array $factory)

Sets a factory.

Parameters

string|array $factory A PHP callable reference

Return Value

$this

final $this file(string $file)

Sets a file to require before creating the service.

Parameters

string $file A full pathname to include

Return Value

$this

final $this lazy(bool $lazy = true)

Sets the lazy flag of this service.

Parameters

bool $lazy

Return Value

$this

final $this tag(string $name, array $attributes = array())

Adds a tag for this definition.

Parameters

string $name The tag name
array $attributes An array of attributes

Return Value

$this

__construct(Definition $definition)

Parameters

Definition $definition