@@ -85,14 +85,17 @@ is really simple and involves creating an
85
85
:doc: `event dispatcher </components/event_dispatcher/introduction >` and a
86
86
:ref: `controller resolver <component-http-kernel-resolve-controller >` (explained
87
87
below). To complete your working kernel, you'll add more event listeners
88
- to the events discussed below
88
+ to the events discussed below.
89
89
90
90
.. caution ::
91
91
92
- As of 3.1 the :class: `Symfony\\ Component\\ Httpkernel\\ HttpKernel ` accepts a fourth argument, which
93
- should be an instance of :class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ArgumentResolverInterface `.
94
- In 4.0 this argument will become mandatory and the :class: `Symfony\\ Component\\ Httpkernel\\ HttpKernel `
95
- will no longer be able to fall back to the :class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ControllerResolver `.
92
+ As of 3.1 the :class: `Symfony\\ Component\\ Httpkernel\\ HttpKernel ` accepts a
93
+ fourth argument, which must be an instance of
94
+ :class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ArgumentResolverInterface `.
95
+ In 4.0 this argument will become mandatory and the
96
+ :class: `Symfony\\ Component\\ Httpkernel\\ HttpKernel `
97
+ will no longer be able to fall back to the
98
+ :class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ControllerResolver `.
96
99
97
100
.. code-block :: php
98
101
@@ -225,18 +228,16 @@ Your job is to create a class that implements the interface and fill in its
225
228
two methods: ``getController `` and ``getArguments ``. In fact, one default
226
229
implementation already exists, which you can use directly or learn from:
227
230
:class: `Symfony\\ Component\\ HttpKernel\\ Controller\\ ControllerResolver `.
228
- This implementation is explained more in the sidebar below
229
-
231
+ This implementation is explained more in the sidebar below.
230
232
231
233
.. caution ::
232
234
233
- The `getArguments() ` method in the :class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ControllerResolver `
235
+ The `` getArguments() ` ` method in the :class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ControllerResolver `
234
236
and respective interface :class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ControllerResolverInterface `
235
237
are deprecated as of 3.1 and will be removed in 4.0. You can use the
236
238
:class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ArgumentResolver ` which uses the
237
239
:class: `Symfony\\ Component\\ Httpkernel\\ Controller\\ ArgumentResolverInterface ` instead.
238
240
239
-
240
241
.. code-block :: php
241
242
242
243
namespace Symfony\Component\HttpKernel\Controller;
@@ -363,9 +364,9 @@ of arguments that should be passed when executing that callable.
363
364
from the ``RouterListener ``).
364
365
365
366
b) If the argument in the controller is type-hinted with Symfony's
366
- :class: `Symfony\\ Component\\ HttpFoundation\\ Request ` object, then the
367
- ``Request `` is passed in as the value. If you have a custom class extending
368
- the ``Request ``, this is also accepted .
367
+ :class: `Symfony\\ Component\\ HttpFoundation\\ Request ` object, the
368
+ ``Request `` is passed in as the value. If you have a custom `` Request ``
369
+ class, it will be injected as long as you extend the Symfony ``Request ``.
369
370
370
371
c) If the function or method argument is `variadic `_ and the ``Request ``
371
372
``attributes `` bag contains and array for that argument, they will all be
@@ -652,7 +653,7 @@ to the core events, use any controller resolver that implements the
652
653
:class: `Symfony\\ Component\\ HttpKernel\\ Controller\\ ControllerResolverInterface ` and
653
654
use any argument resolver that implements the
654
655
:class: `Symfony\\ Component\\ HttpKernel\\ Controller\\ ArgumentResolverInterface `.
655
- However, the HttpKernel component comes with some built-in listeners, and everything
656
+ However, the HttpKernel component comes with some built-in listeners and everything
656
657
else that can be used to create a working example::
657
658
658
659
use Symfony\Component\EventDispatcher\EventDispatcher;
0 commit comments