File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -235,10 +235,10 @@ determine which instance is passed.
235
235
use Symfony\Component\EventDispatcher\EventDispatcher;
236
236
237
237
$containerBuilder = new ContainerBuilder(new ParameterBag());
238
- $containerBuilder->addCompilerPass(new RegisterListenersPass(), PassConfig::TYPE_BEFORE_REMOVING);
239
238
$containerBuilder->addCompilerPass(new AddEventAliasesPass([
240
239
\AcmeFooActionEvent::class => 'acme.foo.action',
241
240
]));
241
+ $containerBuilder->addCompilerPass(new RegisterListenersPass(), PassConfig::TYPE_BEFORE_REMOVING)
242
242
243
243
$containerBuilder->register('event_dispatcher', EventDispatcher::class);
244
244
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ ready to cope with them (by adding a custom error handler like the one used by
126
126
the Web Debug Toolbar or by the PHPUnit bridge).
127
127
128
128
When deprecating a whole class the ``trigger_error() `` call should be placed
129
- between the namespace and the use declarations, like in this example from
129
+ after the use declarations, like in this example from
130
130
`ServiceRouterLoader `_::
131
131
132
132
namespace Symfony\Component\Routing\Loader\DependencyInjection;
Original file line number Diff line number Diff line change @@ -89,14 +89,18 @@ fetched from the container::
89
89
90
90
// gets a specific argument
91
91
$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);
92
96
93
97
// adds a new argument
94
98
$definition->addArgument($argument);
95
99
96
100
// replaces argument on a specific index (0 = first argument)
97
101
$definition->replaceArgument($index, $argument);
98
102
99
- // replace all previously configured arguments with the passed array
103
+ // replaces all previously configured arguments with the passed array
100
104
$definition->setArguments($arguments);
101
105
102
106
.. caution ::
You can’t perform that action at this time.
0 commit comments