From 0dc5efcd698eb1a3afcade0be727c0255bc05f71 Mon Sep 17 00:00:00 2001 From: Felix SOEDJEDE Date: Tue, 7 Apr 2020 10:38:40 +0200 Subject: [PATCH 1/2] [Contributing] Fix `trigger_error()` position in deprecated class The code was added in commit: https://github.com/symfony/symfony-docs/commit/a2c04e717d7e70b485ef1a62fb5231e71add3ee2 The change introducing the issue was added in the PR: https://github.com/symfony/symfony-docs/pull/12075 --- contributing/code/conventions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 31f99fead927738d20c5220a123b37b5141fd1d7 Mon Sep 17 00:00:00 2001 From: Son Tung PHAM <38593523+tungps0811@users.noreply.github.com> Date: Mon, 6 Apr 2020 22:28:18 +0200 Subject: [PATCH 2/2] Update definitions.rst Addition of function 'setArgument' --- service_container/definitions.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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::