diff --git a/contributing/code/conventions.rst b/contributing/code/conventions.rst index 7099ace5db5..05dff1ebf61 100644 --- a/contributing/code/conventions.rst +++ b/contributing/code/conventions.rst @@ -129,7 +129,7 @@ the Web Debug Toolbar or by the PHPUnit bridge). .. _`@-silencing operator`: https://php.net/manual/en/language.operators.errorcontrol.php When deprecating a whole class the ``trigger_error()`` call should be placed -between the namespace and the use declarations, like in this example from +after the use declarations, like in this example from `ServiceRouterLoader`_:: namespace Symfony\Component\Routing\Loader\DependencyInjection; diff --git a/service_container/definitions.rst b/service_container/definitions.rst index 5e74bef8ec9..f4d82d776d2 100644 --- a/service_container/definitions.rst +++ b/service_container/definitions.rst @@ -89,6 +89,10 @@ fetched from the container:: // gets a specific argument $firstArgument = $definition->getArgument(0); + + // adds a new argument with the name of the argument + // $argumentName = the name of the argument in the constructor + $argument = $definition->setArgument('$argumentName', $argumentValue); // adds a new argument $definition->addArgument($argument); @@ -96,7 +100,7 @@ fetched from the container:: // replaces argument on a specific index (0 = first argument) $definition->replaceArgument($index, $argument); - // replace all previously configured arguments with the passed array + // replaces all previously configured arguments with the passed array $definition->setArguments($arguments); .. caution::