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.
@api
integer $index:
mixed The argument value
Overrides Definition::getArgument
public function getArgument($index) {
if (array_key_exists('index_' . $index, $this->arguments)) {
return $this->arguments['index_' . $index];
}
$lastIndex = count(array_filter(array_keys($this->arguments), 'is_int')) - 1;
if ($index < 0 || $index > $lastIndex) {
throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, $lastIndex));
}
return $this->arguments[$index];
}