You are here

public function Definition::getArgument in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Definition.php \Symfony\Component\DependencyInjection\Definition::getArgument()

Gets an argument to pass to the service constructor/factory method.

Parameters

int $index:

Return value

mixed The argument value

Throws

OutOfBoundsException When the argument does not exist

1 method overrides Definition::getArgument()
DefinitionDecorator::getArgument in vendor/symfony/dependency-injection/DefinitionDecorator.php
Gets an argument to pass to the service constructor/factory method.

File

vendor/symfony/dependency-injection/Definition.php, line 333

Class

Definition
Definition represents a service definition.

Namespace

Symfony\Component\DependencyInjection

Code

public function getArgument($index) {
  if ($index < 0 || $index > count($this->arguments) - 1) {
    throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1));
  }
  return $this->arguments[$index];
}