Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ChildDefinition.php

function ChildDefinition::getArgument

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

Overrides Definition::getArgument

File

vendor/symfony/dependency-injection/ChildDefinition.php, line 60

Class

ChildDefinition
This definition extends another definition.

Namespace

Symfony\Component\DependencyInjection

Code

public function getArgument(int|string $index) : mixed {
    if (\array_key_exists('index_' . $index, $this->arguments)) {
        return $this->arguments['index_' . $index];
    }
    return parent::getArgument($index);
}
RSS feed
Powered by Drupal