ChildDefinition
extends Definition
in package
This definition extends another definition.
Tags
Table of Contents
Constants
- DEFAULT_DEPRECATION_TEMPLATE = 'The "%service_id%" service is deprecated. You should stop using it, as it will be removed in the future.'
Properties
- $arguments : mixed
- $abstract : bool
- $autoconfigured : bool
- $autowired : bool
- $bindings : array<string|int, mixed>
- $calls : array<string|int, mixed>
- $changes : array<string|int, mixed>
- $class : string|null
- $configurator : string|array<string|int, mixed>|null
- $decoratedService : array<string|int, mixed>|null
- $deprecation : array<string|int, mixed>
- $errors : array<string|int, mixed>
- $factory : string|array<string|int, mixed>|null
- $file : string|null
- $instanceof : array<string|int, mixed>
- $lazy : bool
- $parent : string
- $properties : array<string|int, mixed>
- $public : bool
- $shared : bool
- $synthetic : bool
- $tags : array<string|int, mixed>
Methods
- __construct() : mixed
- addArgument() : $this
- Adds an argument to pass to the service constructor/factory method.
- addError() : $this
- Add an error that occurred when building this Definition.
- addMethodCall() : $this
- Adds a method to call after service initialization.
- addTag() : $this
- Adds a tag for this definition.
- clearTag() : $this
- Clears all tags for a given name.
- clearTags() : $this
- Clears the tags for this definition.
- getArgument() : mixed
- Gets an argument to pass to the service constructor/factory method.
- getArguments() : array<string|int, mixed>
- Gets the arguments to pass to the service constructor/factory method.
- getBindings() : array<string|int, BoundArgument>
- Gets bindings.
- getChanges() : array<string|int, mixed>
- Returns all changes tracked for the Definition object.
- getClass() : string|null
- Gets the service class.
- getConfigurator() : string|array<string|int, mixed>|null
- Gets the configurator to call after the service is fully initialized.
- getDecoratedService() : array<string|int, mixed>|null
- Gets the service that this service is decorating.
- getDeprecation() : array<string|int, mixed>
- getErrors() : array<string|int, mixed>
- Returns any errors that occurred while building this Definition.
- getFactory() : string|array<string|int, mixed>|null
- Gets the factory.
- getFile() : string|null
- Gets the file to require before creating the service.
- getInstanceofConditionals() : array<string|int, ChildDefinition>
- Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
- getMethodCalls() : array<string|int, mixed>
- Gets the methods to call after service initialization.
- getParent() : string
- Returns the Definition to inherit from.
- getProperties() : array<string|int, mixed>
- Gets the properties to define when creating the service.
- getTag() : array<string|int, mixed>
- Gets a tag by name.
- getTags() : array<string|int, mixed>
- Returns all tags.
- hasErrors() : bool
- hasMethodCall() : bool
- Check if the current definition has a given method to call after service initialization.
- hasTag() : bool
- Whether this definition has a tag with the given name.
- isAbstract() : bool
- Whether this definition is abstract, that means it merely serves as a template for other definitions.
- isAutoconfigured() : bool
- isAutowired() : bool
- Is the definition autowired?
- isDeprecated() : bool
- Whether this definition is deprecated, that means it should not be called anymore.
- isLazy() : bool
- Whether this service is lazy.
- isPrivate() : bool
- Whether this service is private.
- isPublic() : bool
- Whether this service is public facing.
- isShared() : bool
- Whether this service is shared.
- isSynthetic() : bool
- Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
- removeMethodCall() : $this
- Removes a method to call after service initialization.
- replaceArgument() : $this
- You should always use this method when overwriting existing arguments of the parent definition.
- setAbstract() : $this
- Whether this definition is abstract, that means it merely serves as a template for other definitions.
- setArgument() : $this
- Sets a specific argument.
- setArguments() : $this
- Sets the arguments to pass to the service constructor/factory method.
- setAutoconfigured() : $this
- Sets whether or not instanceof conditionals should be prepended with a global set.
- setAutowired() : $this
- Enables/disables autowiring.
- setBindings() : $this
- Sets bindings.
- setChanges() : $this
- Sets the tracked changes for the Definition object.
- setClass() : $this
- Sets the service class.
- setConfigurator() : $this
- Sets a configurator to call after the service is fully initialized.
- setDecoratedService() : $this
- Sets the service that this service is decorating.
- setDeprecated() : $this
- Whether this definition is deprecated, that means it should not be called anymore.
- setFactory() : $this
- Sets a factory.
- setFile() : $this
- Sets a file to require before creating the service.
- setInstanceofConditionals() : $this
- Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
- setLazy() : $this
- Sets the lazy flag of this service.
- setMethodCalls() : $this
- Sets the methods to call after service initialization.
- setParent() : $this
- Sets the Definition to inherit from.
- setProperties() : $this
- Sets the properties to define when creating the service.
- setProperty() : $this
- Sets a specific property.
- setPublic() : $this
- Sets the visibility of this service.
- setShared() : $this
- Sets if the service must be shared or not.
- setSynthetic() : $this
- Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
- setTags() : $this
- Sets tags for this definition.
Constants
DEFAULT_DEPRECATION_TEMPLATE
private
mixed
DEFAULT_DEPRECATION_TEMPLATE
= 'The "%service_id%" service is deprecated. You should stop using it, as it will be removed in the future.'
Properties
$arguments
protected
mixed
$arguments
= []
$abstract
private
bool
$abstract
= false
$autoconfigured
private
bool
$autoconfigured
= false
$autowired
private
bool
$autowired
= false
$bindings
private
array<string|int, mixed>
$bindings
= []
$calls
private
array<string|int, mixed>
$calls
= []
$changes
private
array<string|int, mixed>
$changes
= []
$class
private
string|null
$class
= null
$configurator
private
string|array<string|int, mixed>|null
$configurator
= null
$decoratedService
private
array<string|int, mixed>|null
$decoratedService
= null
$deprecation
private
array<string|int, mixed>
$deprecation
= []
$errors
private
array<string|int, mixed>
$errors
= []
$factory
private
string|array<string|int, mixed>|null
$factory
= null
$file
private
string|null
$file
= null
$instanceof
private
array<string|int, mixed>
$instanceof
= []
$lazy
private
bool
$lazy
= false
$parent
private
string
$parent
$properties
private
array<string|int, mixed>
$properties
= []
$public
private
bool
$public
= false
$shared
private
bool
$shared
= true
$synthetic
private
bool
$synthetic
= false
$tags
private
array<string|int, mixed>
$tags
= []
Methods
__construct()
public
__construct(string $parent) : mixed
Parameters
- $parent : string
-
The id of Definition instance to decorate
addArgument()
Adds an argument to pass to the service constructor/factory method.
public
addArgument(mixed $argument) : $this
Parameters
- $argument : mixed
Return values
$thisaddError()
Add an error that occurred when building this Definition.
public
addError(string|Closure|Definition $error) : $this
Parameters
- $error : string|Closure|Definition
Return values
$thisaddMethodCall()
Adds a method to call after service initialization.
public
addMethodCall(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
$thisaddTag()
Adds a tag for this definition.
public
addTag(string $name[, array<string|int, mixed> $attributes = [] ]) : $this
Parameters
- $name : string
- $attributes : array<string|int, mixed> = []
Return values
$thisclearTag()
Clears all tags for a given name.
public
clearTag(string $name) : $this
Parameters
- $name : string
Return values
$thisclearTags()
Clears the tags for this definition.
public
clearTags() : $this
Return values
$thisgetArgument()
Gets an argument to pass to the service constructor/factory method.
public
getArgument(int|string $index) : mixed
If replaceArgument() has been used to replace an argument, this method will return the replacement value.
Parameters
- $index : int|string
Tags
getArguments()
Gets the arguments to pass to the service constructor/factory method.
public
getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>getBindings()
Gets bindings.
public
getBindings() : array<string|int, BoundArgument>
Return values
array<string|int, BoundArgument>getChanges()
Returns all changes tracked for the Definition object.
public
getChanges() : array<string|int, mixed>
Return values
array<string|int, mixed>getClass()
Gets the service class.
public
getClass() : string|null
Return values
string|nullgetConfigurator()
Gets the configurator to call after the service is fully initialized.
public
getConfigurator() : string|array<string|int, mixed>|null
Return values
string|array<string|int, mixed>|nullgetDecoratedService()
Gets the service that this service is decorating.
public
getDecoratedService() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —An array composed of the decorated service id, the new id for it and the priority of decoration, null if no service is decorated
getDeprecation()
public
getDeprecation(string $id) : array<string|int, mixed>
Parameters
- $id : string
-
Service id relying on this definition
Return values
array<string|int, mixed>getErrors()
Returns any errors that occurred while building this Definition.
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>getFactory()
Gets the factory.
public
getFactory() : string|array<string|int, mixed>|null
Return values
string|array<string|int, mixed>|null —The PHP function or an array containing a class/Reference and a method to call
getFile()
Gets the file to require before creating the service.
public
getFile() : string|null
Return values
string|nullgetInstanceofConditionals()
Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
public
getInstanceofConditionals() : array<string|int, ChildDefinition>
Return values
array<string|int, ChildDefinition>getMethodCalls()
Gets the methods to call after service initialization.
public
getMethodCalls() : array<string|int, mixed>
Return values
array<string|int, mixed>getParent()
Returns the Definition to inherit from.
public
getParent() : string
Return values
stringgetProperties()
Gets the properties to define when creating the service.
public
getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed>getTag()
Gets a tag by name.
public
getTag(string $name) : array<string|int, mixed>
Parameters
- $name : string
Return values
array<string|int, mixed>getTags()
Returns all tags.
public
getTags() : array<string|int, mixed>
Return values
array<string|int, mixed>hasErrors()
public
hasErrors() : bool
Return values
boolhasMethodCall()
Check if the current definition has a given method to call after service initialization.
public
hasMethodCall(string $method) : bool
Parameters
- $method : string
Return values
boolhasTag()
Whether this definition has a tag with the given name.
public
hasTag(string $name) : bool
Parameters
- $name : string
Return values
boolisAbstract()
Whether this definition is abstract, that means it merely serves as a template for other definitions.
public
isAbstract() : bool
Return values
boolisAutoconfigured()
public
isAutoconfigured() : bool
Return values
boolisAutowired()
Is the definition autowired?
public
isAutowired() : bool
Return values
boolisDeprecated()
Whether this definition is deprecated, that means it should not be called anymore.
public
isDeprecated() : bool
Return values
boolisLazy()
Whether this service is lazy.
public
isLazy() : bool
Return values
boolisPrivate()
Whether this service is private.
public
isPrivate() : bool
Return values
boolisPublic()
Whether this service is public facing.
public
isPublic() : bool
Return values
boolisShared()
Whether this service is shared.
public
isShared() : bool
Return values
boolisSynthetic()
Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
public
isSynthetic() : bool
Return values
boolremoveMethodCall()
Removes a method to call after service initialization.
public
removeMethodCall(string $method) : $this
Parameters
- $method : string
Return values
$thisreplaceArgument()
You should always use this method when overwriting existing arguments of the parent definition.
public
replaceArgument(int|string $index, mixed $value) : $this
If you directly call setArguments() keep in mind that you must follow certain conventions when you want to overwrite the arguments of the parent definition, otherwise your arguments will only be appended.
Parameters
- $index : int|string
- $value : mixed
Tags
Return values
$thissetAbstract()
Whether this definition is abstract, that means it merely serves as a template for other definitions.
public
setAbstract(bool $boolean) : $this
Parameters
- $boolean : bool
Return values
$thissetArgument()
Sets a specific argument.
public
setArgument(int|string $key, mixed $value) : $this
Parameters
- $key : int|string
- $value : mixed
Return values
$thissetArguments()
Sets the arguments to pass to the service constructor/factory method.
public
setArguments(array<string|int, mixed> $arguments) : $this
Parameters
- $arguments : array<string|int, mixed>
Return values
$thissetAutoconfigured()
Sets whether or not instanceof conditionals should be prepended with a global set.
public
setAutoconfigured(bool $autoconfigured) : $this
Parameters
- $autoconfigured : bool
Return values
$thissetAutowired()
Enables/disables autowiring.
public
setAutowired(bool $autowired) : $this
Parameters
- $autowired : bool
Return values
$thissetBindings()
Sets bindings.
public
setBindings(array<string|int, mixed> $bindings) : $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
- $bindings : array<string|int, mixed>
Return values
$thissetChanges()
Sets the tracked changes for the Definition object.
public
setChanges(array<string|int, mixed> $changes) : $this
Parameters
- $changes : array<string|int, mixed>
-
An array of changes for this Definition
Return values
$thissetClass()
Sets the service class.
public
setClass(string|null $class) : $this
Parameters
- $class : string|null
Return values
$thissetConfigurator()
Sets a configurator to call after the service is fully initialized.
public
setConfigurator(string|array<string|int, mixed>|Reference|null $configurator) : $this
Parameters
- $configurator : string|array<string|int, mixed>|Reference|null
-
A PHP function, reference or an array containing a class/Reference and a method to call
Return values
$thissetDecoratedService()
Sets the service that this service is decorating.
public
setDecoratedService(string|null $id[, string|null $renamedId = null ][, int $priority = 0 ][, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE ]) : $this
Parameters
- $id : string|null
-
The decorated service id, use null to remove decoration
- $renamedId : string|null = null
-
The new decorated service id
- $priority : int = 0
- $invalidBehavior : int = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE
Tags
Return values
$thissetDeprecated()
Whether this definition is deprecated, that means it should not be called anymore.
public
setDeprecated(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
$thissetFactory()
Sets a factory.
public
setFactory(string|array<string|int, mixed>|Reference|null $factory) : $this
Parameters
- $factory : string|array<string|int, mixed>|Reference|null
-
A PHP function, reference or an array containing a class/Reference and a method to call
Return values
$thissetFile()
Sets a file to require before creating the service.
public
setFile(string|null $file) : $this
Parameters
- $file : string|null
Return values
$thissetInstanceofConditionals()
Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
public
setInstanceofConditionals(array<string|int, ChildDefinition> $instanceof) : $this
Parameters
- $instanceof : array<string|int, ChildDefinition>
Return values
$thissetLazy()
Sets the lazy flag of this service.
public
setLazy(bool $lazy) : $this
Parameters
- $lazy : bool
Return values
$thissetMethodCalls()
Sets the methods to call after service initialization.
public
setMethodCalls([array<string|int, mixed> $calls = [] ]) : $this
Parameters
- $calls : array<string|int, mixed> = []
Return values
$thissetParent()
Sets the Definition to inherit from.
public
setParent(string $parent) : $this
Parameters
- $parent : string
Return values
$thissetProperties()
Sets the properties to define when creating the service.
public
setProperties(array<string|int, mixed> $properties) : $this
Parameters
- $properties : array<string|int, mixed>
Return values
$thissetProperty()
Sets a specific property.
public
setProperty(string $name, mixed $value) : $this
Parameters
- $name : string
- $value : mixed
Return values
$thissetPublic()
Sets the visibility of this service.
public
setPublic(bool $boolean) : $this
Parameters
- $boolean : bool
Return values
$thissetShared()
Sets if the service must be shared or not.
public
setShared(bool $shared) : $this
Parameters
- $shared : bool
Return values
$thissetSynthetic()
Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
public
setSynthetic(bool $boolean) : $this
Parameters
- $boolean : bool
Return values
$thissetTags()
Sets tags for this definition.
public
setTags(array<string|int, mixed> $tags) : $this
Parameters
- $tags : array<string|int, mixed>