8000 Merge branch '5.0' · symfony/symfony-docs@745fb92 · GitHub
[go: up one dir, main page]

Skip to content

Commit 745fb92

Browse files
committed
Merge branch '5.0'
* 5.0: Update definitions.rst [EventDispatcher] Fix position of `AddEventAliasesPass` [Contributing] Fix `trigger_error()` position in deprecated class
2 parents 059c4bb + fd7b98f commit 745fb92

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

components/event_dispatcher.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ determine which instance is passed.
235235
use Symfony\Component\EventDispatcher\EventDispatcher;
236236

237237
$containerBuilder = new ContainerBuilder(new ParameterBag());
238-
$containerBuilder->addCompilerPass(new RegisterListenersPass(), PassConfig::TYPE_BEFORE_REMOVING);
239238
$containerBuilder->addCompilerPass(new AddEventAliasesPass([
240239
\AcmeFooActionEvent::class => 'acme.foo.action',
241240
]));
241+
$containerBuilder->addCompilerPass(new RegisterListenersPass(), PassConfig::TYPE_BEFORE_REMOVING)
242242

243243
$containerBuilder->register('event_dispatcher', EventDispatcher::class);
244244

contributing/code/conventions.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ A deprecation must also be triggered to help people with the migration
121121

122122
trigger_deprecation('symfony/package-name', '5.1', 'The "%s" class is deprecated, use "%s" instead.', Deprecated::class, Replacement::class);
123123

124-
When deprecating a whole class the ``trigger_deprecation()`` call should be placed
125-
between the namespace and the use declarations, like in this example from
126-
`ServiceRouterLoader`_::
124+
When deprecating a whole class the ``trigger_error()`` call should be placed
125+
after the use declarations, like in this example from `ServiceRouterLoader`_::
127126

128127
namespace Symfony\Component\Routing\Loader\DependencyInjection;
129128

service_container/definitions.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,18 @@ fetched from the container::
8989

9090
// gets a specific argument
9191
$firstArgument = $definition->getArgument(0);
92+
93+
// adds a new argument with the name of the argument
94+
// $argumentName = the name of the argument in the constructor
95+
$argument = $definition->setArgument('$argumentName', $argumentValue);
9296

9397
// adds a new argument
9498
$definition->addArgument($argument);
9599

96100
// replaces argument on a specific index (0 = first argument)
97101
$definition->replaceArgument($index, $argument);
98102

99-
// replace all previously configured arguments with the passed array
103+
// replaces all previously configured arguments with the passed array
100104
$definition->setArguments($arguments);
101105

102106
.. caution::

0 commit comments

Comments
 (0)
0