Sets a specific argument.
public replaceArgument ( integer $index, mixed $argument ) : |
||
$index | integer | |
$argument | mixed | |
return | The current instance |
use Symfony\Component\DependencyInjection\Definition; $definition = new Definition(MyClass::class); $definition->replaceArgument(0, 'modified argument');
use Symfony\Component\DependencyInjection\Definition; $definition = new Definition(MyClass::class); $definition->replaceArgument(1, $container->getParameter('my_param_value'));Here, the second argument passed to the `MyClass` class is being modified. The parameter value fetched from the container is used as the new value of this argument. The `replaceArgument` method is part of the Dependency Injection component of the Symfony framework. It can be found in the `DependencyInjection` package within the `symfony/dependency-injection` library.
public replaceArgument ( integer $index, mixed $argument ) : |
||
$index | integer | |
$argument | mixed | |
return | The current instance |