PrototypeConfigurator
class PrototypeConfigurator extends AbstractServiceConfigurator
Traits
Constants
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 |
|
__construct(ServicesConfigurator $parent, PhpFileLoader $loader, Definition $defaults, $namespace, $resource, $allowParent) |
|
|
__destruct() |
|
ServiceConfigurator |
set(string $id, string|null $class = null) Registers a service. |
from AbstractServiceConfigurator |
AliasConfigurator |
alias($id, $referencedId) Creates an alias. |
from AbstractServiceConfigurator |
PrototypeConfigurator |
load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. |
from AbstractServiceConfigurator |
ServiceConfigurator |
get(string $id) Gets an already defined service definition. |
from AbstractServiceConfigurator |
ServiceConfigurator |
__invoke(string $id, string|null $class = null) Registers a service. |
from AbstractServiceConfigurator |
$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 |
autoconfigure(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. |
from AutoconfigureTrait |
$this |
autowire(bool $autowired = true) Enables/disables autowiring. |
from AutowireTrait |
$this |
bind(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. |
from BindTrait |
$this |
call(string $method, array $arguments = array()) 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. |
from ConfiguratorTrait |
$this |
deprecate(string $template = null) Whether this definition is deprecated, that means it should not be called anymore. |
from DeprecateTrait |
$this |
factory(string|array $factory) Sets a factory. |
from FactoryTrait |
$this |
lazy(bool $lazy = true) Sets the lazy flag of this service. |
from LazyTrait |
$this |
property(string $name, mixed $value) Sets a specific property. |
from PropertyTrait |
$this |
share(bool $shared = true) Sets if the service must be shared or not. |
from ShareTrait |
$this |
tag(string $name, array $attributes = array()) Adds a tag for this definition. |
from TagTrait |
$this |
exclude(string $exclude) Excludes files from registration using a glob pattern. |
|
Details
__call($method, $args)
Parameters
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 |
Parameters
__destruct()
final ServiceConfigurator set(string $id, string|null $class = null)
Registers a service.
Parameters
string |
$id |
|
string|null |
$class |
|
Return Value
Creates an alias.
Parameters
Return Value
final PrototypeConfigurator load(string $namespace, string $resource)
Registers a PSR-4 namespace using a glob pattern.
Parameters
string |
$namespace |
|
string |
$resource |
|
Return Value
Gets an already defined service definition.
Parameters
Return Value
Exceptions
final ServiceConfigurator __invoke(string $id, string|null $class = null)
Registers a service.
Parameters
string |
$id |
|
string|null |
$class |
|
Return Value
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
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
Sets whether or not instanceof conditionals should be prepended with a global set.
Parameters
Return Value
Exceptions
final $this autowire(bool $autowired = true)
Enables/disables autowiring.
Parameters
Return Value
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
final $this call(string $method, array $arguments = array())
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
Exceptions
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
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
Exceptions
final $this factory(string|array $factory)
Sets a factory.
Parameters
string|array |
$factory |
A PHP callable reference |
Return Value
final $this lazy(bool $lazy = true)
Sets the lazy flag of this service.
Parameters
Return Value
final $this property(string $name, mixed $value)
Sets a specific property.
Parameters
string |
$name |
|
mixed |
$value |
|
Return Value
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
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
final $this exclude(string $exclude)
Excludes files from registration using a glob pattern.
Parameters
Return Value