class PrototypeConfigurator extends AbstractServiceConfigurator

Traits

Constants

FACTORY

Properties

protected $definition from AbstractConfigurator
protected $parent from AbstractServiceConfigurator
protected $id from AbstractServiceConfigurator

Methods

__call($method, $args)

No description

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

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

__construct(ServicesConfigurator $parent, PhpFileLoader $loader, Definition $defaults, $namespace, $resource, $allowParent)

No description

__destruct()

No description

set(string $id, string|null $class = null)

Registers a service.

alias(string $id, string $referencedId)

Creates an alias.

load(string $namespace, string $resource)

Registers a PSR-4 namespace using a glob pattern.

get(string $id)

Gets an already defined service definition.

__invoke(string $id, string|null $class = null)

Registers a service.

$this
setAbstract(bool $abstract = true)

Whether this definition is abstract, that means it merely serves as a template for other definitions.

$this
args(array $arguments)

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

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

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

$this
autoconfigure(bool $autoconfigured = true)

Sets whether or not instanceof conditionals should be prepended with a global set.

$this
autowire(bool $autowired = true)

Enables/disables autowiring.

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

Sets bindings.

from BindTrait
$this
call(string $method, array $arguments = [])

Adds a method to call after service initialization.

from CallTrait
$this
configurator(string|array $configurator)

Sets a configurator to call after the service is fully initialized.

$this
deprecate(string $template = null)

Whether this definition is deprecated, that means it should not be called anymore.

$this
factory(string|array $factory)

Sets a factory.

$this
lazy(bool $lazy = true)

Sets the lazy flag of this service.

from LazyTrait
$this
setParent(string $parent)

Sets the Definition to inherit from.

$this
property(string $name, mixed $value)

Sets a specific property.

$this
setPublic()

No description

$this
setPrivate()

No description

$this
share(bool $shared = true)

Sets if the service must be shared or not.

$this
tag(string $name, array $attributes = [])

Adds a tag for this definition.

from TagTrait
$this
exclude(string $exclude)

Excludes files from registration using a glob pattern.

Details

in AbstractConfigurator at line 28
__call($method, $args)

Parameters

$method
$args

in AbstractConfigurator at line 45
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, optionally cast to a Definition/Reference

at line 45
__construct(ServicesConfigurator $parent, PhpFileLoader $loader, Definition $defaults, $namespace, $resource, $allowParent)

Parameters

ServicesConfigurator $parent
PhpFileLoader $loader
Definition $defaults
$namespace
$resource
$allowParent

at line 61
__destruct()

final ServiceConfigurator set(string $id, string|null $class = null)

Registers a service.

Parameters

string $id
string|null $class

Return Value

ServiceConfigurator

final AliasConfigurator alias(string $id, string $referencedId)

Creates an alias.

Parameters

string $id
string $referencedId

Return Value

AliasConfigurator

final PrototypeConfigurator load(string $namespace, string $resource)

Registers a PSR-4 namespace using a glob pattern.

Parameters

string $namespace
string $resource

Return Value

PrototypeConfigurator

final ServiceConfigurator get(string $id)

Gets an already defined service definition.

Parameters

string $id

Return Value

ServiceConfigurator

Exceptions

ServiceNotFoundException if the service definition does not exist

final ServiceConfigurator __invoke(string $id, string|null $class = null)

Registers a service.

Parameters

string $id
string|null $class

Return Value

ServiceConfigurator

in AbstractTrait at line 27
final protected $this setAbstract(bool $abstract = true)

Whether this definition is abstract, that means it merely serves as a template for other definitions.

Parameters

bool $abstract

Return Value

$this

in ArgumentTrait at line 23
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

in ArgumentTrait at line 38
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

in AutoconfigureTrait at line 28
final $this autoconfigure(bool $autoconfigured = true)

Sets whether or not instanceof conditionals should be prepended with a global set.

Parameters

bool $autoconfigured

Return Value

$this

Exceptions

InvalidArgumentException when a parent is already set

in AutowireTrait at line 23
final $this autowire(bool $autowired = true)

Enables/disables autowiring.

Parameters

bool $autowired

Return Value

$this

in BindTrait at line 31
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

in CallTrait at line 28
final $this call(string $method, array $arguments = [])

Adds a method to call after service initialization.

Parameters

string $method The method name to call
array $arguments An array of arguments to pass to the method call

Return Value

$this

Exceptions

InvalidArgumentException on empty $method param

in ConfiguratorTrait at line 23
final $this configurator(string|array $configurator)

Sets a configurator to call after the service is fully initialized.

Parameters

string|array $configurator A PHP callable reference

Return Value

$this

in DeprecateTrait at line 27
final $this deprecate(string $template = null)

Whether this definition is deprecated, that means it should not be called anymore.

Parameters

string $template Template message to use if the definition is deprecated

Return Value

$this

Exceptions

InvalidArgumentException when the message template is invalid

in FactoryTrait at line 25
final $this factory(string|array $factory)

Sets a factory.

Parameters

string|array $factory A PHP callable reference

Return Value

$this

in LazyTrait at line 23
final $this lazy(bool $lazy = true)

Sets the lazy flag of this service.

Parameters

bool $lazy

Return Value

$this

in ParentTrait at line 31
final protected $this setParent(string $parent)

Sets the Definition to inherit from.

Parameters

string $parent

Return Value

$this

Exceptions

InvalidArgumentException when parent cannot be set

in PropertyTrait at line 24
final $this property(string $name, mixed $value)

Sets a specific property.

Parameters

string $name
mixed $value

Return Value

$this

in PublicTrait at line 23
final protected $this setPublic()

Return Value

$this

in PublicTrait at line 33
final protected $this setPrivate()

Return Value

$this

in ShareTrait at line 23
final $this share(bool $shared = true)

Sets if the service must be shared or not.

Parameters

bool $shared Whether the service must be shared or not

Return Value

$this

in TagTrait at line 26
final $this tag(string $name, array $attributes = [])

Adds a tag for this definition.

Parameters

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

Return Value

$this

at line 78
final $this exclude(string $exclude)

Excludes files from registration using a glob pattern.

Parameters

string $exclude

Return Value

$this