PrototypeConfigurator
extends AbstractServiceConfigurator
in package
uses
AbstractTrait, ArgumentTrait, AutoconfigureTrait, AutowireTrait, BindTrait, CallTrait, ConfiguratorTrait, ConstructorTrait, DeprecateTrait, FactoryTrait, LazyTrait, ParentTrait, PropertyTrait, PublicTrait, ShareTrait, TagTrait
Tags
Table of Contents
Constants
- FACTORY = 'load'
Properties
- $valuePreProcessor : callable(mixed, bool): mixed|null
- $id : mixed
- $parent : mixed
- $allowParent : bool
- $excludes : array<string|int, mixed>|null
- $loader : PhpFileLoader
- $path : string|null
- $resource : string
Methods
- __call() : mixed
- __construct() : mixed
- __destruct() : mixed
- __invoke() : ServiceConfigurator
- Registers a service.
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- abstract() : $this
- Whether this definition is abstract, that means it merely serves as a template for other definitions.
- alias() : AliasConfigurator
- Creates an alias.
- 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.
- autoconfigure() : $this
- Sets whether or not instanceof conditionals should be prepended with a global set.
- 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.
- constructor() : $this
- Sets a static constructor.
- deprecate() : $this
- Whether this definition is deprecated, that means it should not be called anymore.
- exclude() : $this
- Excludes files from registration using glob patterns.
- factory() : $this
- Sets a factory.
- get() : ServiceConfigurator
- Gets an already defined service definition.
- lazy() : $this
- Sets the lazy flag of this service.
- load() : PrototypeConfigurator
- Registers a PSR-4 namespace using a glob pattern.
- parent() : $this
- Sets the Definition to inherit from.
- private() : $this
- processValue() : mixed
- Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
- property() : $this
- Sets a specific property.
- public() : $this
- remove() : ServicesConfigurator
- Removes an already defined service definition or alias.
- set() : ServiceConfigurator
- Registers a service.
- share() : $this
- Sets if the service must be shared or not.
- stack() : AliasConfigurator
- Registers a stack of decorator services.
- tag() : $this
- Adds a tag for this definition.
- validateAttributes() : void
Constants
FACTORY
public
mixed
FACTORY
= 'load'
Properties
$valuePreProcessor
public
static callable(mixed, bool): mixed|null
$valuePreProcessor
$id
protected
mixed
$id
$parent
protected
mixed
$parent
$allowParent
private
bool
$allowParent
$excludes
private
array<string|int, mixed>|null
$excludes
= null
$loader
private
PhpFileLoader
$loader
$path
private
string|null
$path
$resource
private
string
$resource
Methods
__call()
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
public
__construct(ServicesConfigurator $parent, PhpFileLoader $loader, Definition $defaults, string $namespace, string $resource, bool $allowParent[, string|null $path = null ]) : mixed
Parameters
- $parent : ServicesConfigurator
- $loader : PhpFileLoader
- $defaults : Definition
- $namespace : string
- $resource : string
- $allowParent : bool
- $path : string|null = null
__destruct()
public
__destruct() : 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__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
abstract()
Whether this definition is abstract, that means it merely serves as a template for other definitions.
public
final abstract([bool $abstract = true ]) : $this
Parameters
- $abstract : bool = true
Return values
$thisalias()
Creates an alias.
public
final alias(string $id, string $referencedId) : AliasConfigurator
Parameters
- $id : string
- $referencedId : string
Return values
AliasConfiguratorarg()
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
$thisargs()
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
$thisautoconfigure()
Sets whether or not instanceof conditionals should be prepended with a global set.
public
final autoconfigure([bool $autoconfigured = true ]) : $this
Parameters
- $autoconfigured : bool = true
Tags
Return values
$thisautowire()
Enables/disables autowiring.
public
final autowire([bool $autowired = true ]) : $this
Parameters
- $autowired : bool = true
Return values
$thisbind()
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
$thiscall()
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
$thisconfigurator()
Sets a configurator to call after the service is fully initialized.
public
final configurator(string|array<string|int, mixed>|ReferenceConfigurator $configurator) : $this
Parameters
- $configurator : string|array<string|int, mixed>|ReferenceConfigurator
Return values
$thisconstructor()
Sets a static constructor.
public
final constructor(string $constructor) : $this
Parameters
- $constructor : string
Return values
$thisdeprecate()
Whether this definition is deprecated, that means it should not be called anymore.
public
final deprecate(string $package, string $version, string $message) : $this
Parameters
- $package : string
-
The name of the composer package that is triggering the deprecation
- $version : string
-
The version of the package that introduced the deprecation
- $message : string
-
The deprecation message to use
Tags
Return values
$thisexclude()
Excludes files from registration using glob patterns.
public
final exclude(array<string|int, string>|string $excludes) : $this
Parameters
- $excludes : array<string|int, string>|string
Return values
$thisfactory()
Sets a factory.
public
final factory(string|array<string|int, mixed>|ReferenceConfigurator|Expression $factory) : $this
Parameters
- $factory : string|array<string|int, mixed>|ReferenceConfigurator|Expression
Return values
$thisget()
Gets an already defined service definition.
public
final get(string $id) : ServiceConfigurator
Parameters
- $id : string
Tags
Return values
ServiceConfiguratorlazy()
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
trueto make it extend from the definition's class
Return values
$thisload()
Registers a PSR-4 namespace using a glob pattern.
public
final load(string $namespace, string $resource) : PrototypeConfigurator
Parameters
- $namespace : string
- $resource : string
Return values
PrototypeConfiguratorparent()
Sets the Definition to inherit from.
public
final parent(string $parent) : $this
Parameters
- $parent : string
Tags
Return values
$thisprivate()
public
final private() : $this
Return values
$thisprocessValue()
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, arrays and enum 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
$thispublic()
public
final public() : $this
Return values
$thisremove()
Removes an already defined service definition or alias.
public
final remove(string $id) : ServicesConfigurator
Parameters
- $id : string
Return values
ServicesConfiguratorset()
Registers a service.
public
final set(string|null $id[, string|null $class = null ]) : ServiceConfigurator
Parameters
- $id : string|null
- $class : string|null = null
Return values
ServiceConfiguratorshare()
Sets if the service must be shared or not.
public
final share([bool $shared = true ]) : $this
Parameters
- $shared : bool = true
Return values
$thisstack()
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>
Return values
AliasConfiguratortag()
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> = []
Return values
$thisvalidateAttributes()
private
validateAttributes(string $tag, array<string|int, mixed> $attributes[, array<string|int, mixed> $path = [] ]) : void
Parameters
- $tag : string
- $attributes : array<string|int, mixed>
- $path : array<string|int, mixed> = []