InstanceofConfigurator
extends AbstractServiceConfigurator
in package
Uses
AutowireTrait, BindTrait, CallTrait, ConfiguratorTrait, LazyTrait, PropertyTrait, PublicTrait, ShareTrait, TagTrait
Tags
Table of Contents
- FACTORY = 'instanceof'
- $valuePreProcessor : callable
- $id : mixed
- $parent : mixed
- $defaultTags : mixed
- $path : mixed
- __call() : mixed
- __construct() : mixed
- __destruct() : mixed
- __invoke() : ServiceConfigurator
- Registers a service.
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- alias() : AliasConfigurator
- Creates an alias.
- 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.
- get() : ServiceConfigurator
- Gets an already defined service definition.
- instanceof() : self
- Defines an instanceof-conditional to be applied to following service definitions.
- lazy() : $this
- Sets the lazy flag of this service.
- load() : PrototypeConfigurator
- Registers a PSR-4 namespace using a glob pattern.
- 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.
Constants
FACTORY
public
mixed
FACTORY
= 'instanceof'
Properties
$valuePreProcessor
public
static callable
$valuePreProcessor
(mixed, bool)|null
$id
protected
mixed
$id
$parent
protected
mixed
$parent
$defaultTags
private
mixed
$defaultTags
= []
$path
private
mixed
$path
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(ServicesConfigurator $parent, Definition $definition, string $id[, string|null $path = null ]) : mixed
Parameters
- $parent : ServicesConfigurator
- $definition : Definition
- $id : string
- $path : string|null = null
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
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 —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__wakeup()
public
__wakeup() : mixed
Return values
mixed —alias()
Creates an alias.
public
final alias(string $id, string $referencedId) : AliasConfigurator
Parameters
- $id : string
- $referencedId : string
Return values
AliasConfigurator —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 —get()
Gets an already defined service definition.
public
final get(string $id) : ServiceConfigurator
Parameters
- $id : string
Tags
Return values
ServiceConfigurator —instanceof()
Defines an instanceof-conditional to be applied to following service definitions.
public
final instanceof(string $fqcn) : self
Parameters
- $fqcn : string
Return values
self —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 —load()
Registers a PSR-4 namespace using a glob pattern.
public
final load(string $namespace, string $resource) : PrototypeConfigurator
Parameters
- $namespace : string
- $resource : string
Return values
PrototypeConfigurator —private()
public
final private() : $this
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 —public()
public
final public() : $this
Return values
$this —remove()
Removes an already defined service definition or alias.
public
final remove(string $id) : ServicesConfigurator
Parameters
- $id : string
Return values
ServicesConfigurator —set()
Registers a service.
public
final set(string|null $id[, string|null $class = null ]) : ServiceConfigurator
Parameters
- $id : string|null
- $class : string|null = null
Return values
ServiceConfigurator —share()
Sets if the service must be shared or not.
public
final share([bool $shared = true ]) : $this
Parameters
- $shared : bool = true
Return values
$this —stack()
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
AliasConfigurator —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> = []