class ChildDefinition
This definition extends another definition.
@author Johannes M. Schmitt <schmittjoh@gmail.com>
Hierarchy
- class \Symfony\Component\DependencyInjection\Definition
- class \Symfony\Component\DependencyInjection\ChildDefinition extends \Symfony\Component\DependencyInjection\Definition
Expanded class hierarchy of ChildDefinition
16 files declare their use of ChildDefinition
- AbstractRecursivePass.php in vendor/
symfony/ dependency-injection/ Compiler/ AbstractRecursivePass.php - AttributeAutoconfigurationPass.php in vendor/
symfony/ dependency-injection/ Compiler/ AttributeAutoconfigurationPass.php - FileLoader.php in vendor/
symfony/ dependency-injection/ Loader/ FileLoader.php - FromCallableTrait.php in vendor/
symfony/ dependency-injection/ Loader/ Configurator/ Traits/ FromCallableTrait.php - LayoutBuilderServiceProvider.php in core/
modules/ layout_builder/ src/ LayoutBuilderServiceProvider.php
File
-
vendor/
symfony/ dependency-injection/ ChildDefinition.php, line 22
Namespace
Symfony\Component\DependencyInjectionView source
class ChildDefinition extends Definition {
/**
* @param string $parent The id of Definition instance to decorate
*/
public function __construct(string $parent) {
}
/**
* Returns the Definition to inherit from.
*/
public function getParent() : string {
return $this->parent;
}
/**
* Sets the Definition to inherit from.
*
* @return $this
*/
public function setParent(string $parent) : static {
$this->parent = $parent;
return $this;
}
/**
* Gets an argument to pass to the service constructor/factory method.
*
* If replaceArgument() has been used to replace an argument, this method
* will return the replacement value.
*
* @throws OutOfBoundsException When the argument does not exist
*/
public function getArgument(int|string $index) : mixed {
if (\array_key_exists('index_' . $index, $this->arguments)) {
return $this->arguments['index_' . $index];
}
return parent::getArgument($index);
}
/**
* You should always use this method when overwriting existing arguments
* of the parent definition.
*
* 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.
*
* @return $this
*
* @throws InvalidArgumentException when $index isn't an integer
*/
public function replaceArgument(int|string $index, mixed $value) : static {
if (\is_int($index)) {
$this->arguments['index_' . $index] = $value;
}
elseif (str_starts_with($index, '$')) {
$this->arguments[$index] = $value;
}
else {
throw new InvalidArgumentException('The argument must be an existing index or the name of a constructor\'s parameter.');
}
return $this;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ChildDefinition::getArgument | public | function | Gets an argument to pass to the service constructor/factory method. | Overrides Definition::getArgument |
ChildDefinition::getParent | public | function | Returns the Definition to inherit from. | |
ChildDefinition::replaceArgument | public | function | You should always use this method when overwriting existing arguments of the parent definition. |
Overrides Definition::replaceArgument |
ChildDefinition::setParent | public | function | Sets the Definition to inherit from. | |
ChildDefinition::__construct | public | function | Overrides Definition::__construct | |
Definition::$abstract | private | property | ||
Definition::$arguments | protected | property | ||
Definition::$autoconfigured | private | property | ||
Definition::$autowired | private | property | ||
Definition::$bindings | private | property | ||
Definition::$calls | private | property | ||
Definition::$changes | private | property | ||
Definition::$class | private | property | ||
Definition::$configurator | private | property | ||
Definition::$decoratedService | private | property | ||
Definition::$decorationOnInvalid | public | property | @internal | |
Definition::$deprecation | private | property | ||
Definition::$errors | private | property | ||
Definition::$factory | private | property | ||
Definition::$file | private | property | ||
Definition::$innerServiceId | public | property | @internal | |
Definition::$instanceof | private | property | ||
Definition::$lazy | private | property | ||
Definition::$properties | private | property | ||
Definition::$public | private | property | ||
Definition::$shared | private | property | ||
Definition::$synthetic | private | property | ||
Definition::$tags | private | property | ||
Definition::addArgument | public | function | Adds an argument to pass to the service constructor/factory method. | |
Definition::addError | public | function | Add an error that occurred when building this Definition. | |
Definition::addMethodCall | public | function | Adds a method to call after service initialization. | |
Definition::addTag | public | function | Adds a tag for this definition. | |
Definition::clearTag | public | function | Clears all tags for a given name. | |
Definition::clearTags | public | function | Clears the tags for this definition. | |
Definition::DEFAULT_DEPRECATION_TEMPLATE | private | constant | ||
Definition::getArguments | public | function | Gets the arguments to pass to the service constructor/factory method. | |
Definition::getBindings | public | function | Gets bindings. | |
Definition::getChanges | public | function | Returns all changes tracked for the Definition object. | |
Definition::getClass | public | function | Gets the service class. | |
Definition::getConfigurator | public | function | Gets the configurator to call after the service is fully initialized. | |
Definition::getDecoratedService | public | function | Gets the service that this service is decorating. | |
Definition::getDeprecation | public | function | ||
Definition::getErrors | public | function | Returns any errors that occurred while building this Definition. | |
Definition::getFactory | public | function | Gets the factory. | |
Definition::getFile | public | function | Gets the file to require before creating the service. | |
Definition::getInstanceofConditionals | public | function | Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. | |
Definition::getMethodCalls | public | function | Gets the methods to call after service initialization. | |
Definition::getProperties | public | function | Gets the properties to define when creating the service. | |
Definition::getTag | public | function | Gets a tag by name. | |
Definition::getTags | public | function | Returns all tags. | |
Definition::hasErrors | public | function | ||
Definition::hasMethodCall | public | function | Check if the current definition has a given method to call after service initialization. | |
Definition::hasTag | public | function | Whether this definition has a tag with the given name. | |
Definition::isAbstract | public | function | Whether this definition is abstract, that means it merely serves as a template for other definitions. |
|
Definition::isAutoconfigured | public | function | ||
Definition::isAutowired | public | function | Is the definition autowired? | |
Definition::isDeprecated | public | function | Whether this definition is deprecated, that means it should not be called anymore. |
|
Definition::isLazy | public | function | Whether this service is lazy. | |
Definition::isPrivate | public | function | Whether this service is private. | |
Definition::isPublic | public | function | Whether this service is public facing. | |
Definition::isShared | public | function | Whether this service is shared. | |
Definition::isSynthetic | public | function | Whether this definition is synthetic, that is not constructed by the container, but dynamically injected. |
|
Definition::removeMethodCall | public | function | Removes a method to call after service initialization. | |
Definition::setAbstract | public | function | Whether this definition is abstract, that means it merely serves as a template for other definitions. |
|
Definition::setArgument | public | function | Sets a specific argument. | |
Definition::setArguments | public | function | Sets the arguments to pass to the service constructor/factory method. | |
Definition::setAutoconfigured | public | function | Sets whether or not instanceof conditionals should be prepended with a global set. | |
Definition::setAutowired | public | function | Enables/disables autowiring. | |
Definition::setBindings | public | function | Sets bindings. | |
Definition::setChanges | public | function | Sets the tracked changes for the Definition object. | |
Definition::setClass | public | function | Sets the service class. | |
Definition::setConfigurator | public | function | Sets a configurator to call after the service is fully initialized. | |
Definition::setDecoratedService | public | function | Sets the service that this service is decorating. | |
Definition::setDeprecated | public | function | Whether this definition is deprecated, that means it should not be called anymore. |
|
Definition::setFactory | public | function | Sets a factory. | |
Definition::setFile | public | function | Sets a file to require before creating the service. | |
Definition::setInstanceofConditionals | public | function | Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. | |
Definition::setLazy | public | function | Sets the lazy flag of this service. | |
Definition::setMethodCalls | public | function | Sets the methods to call after service initialization. | |
Definition::setProperties | public | function | Sets the properties to define when creating the service. | |
Definition::setProperty | public | function | Sets a specific property. | |
Definition::setPublic | public | function | Sets the visibility of this service. | |
Definition::setShared | public | function | Sets if the service must be shared or not. | |
Definition::setSynthetic | public | function | Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. |
|
Definition::setTags | public | function | Sets tags for this definition. |