Skip to content

Commit a26f622

Browse files
committed
Processed feedback
1 parent 4edfe5a commit a26f622

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

components/http_kernel/introduction.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,17 @@ is really simple and involves creating an
8585
:doc:`event dispatcher </components/event_dispatcher/introduction>` and a
8686
:ref:`controller resolver <component-http-kernel-resolve-controller>` (explained
8787
below). To complete your working kernel, you'll add more event listeners
88-
to the events discussed below
88+
to the events discussed below.
8989

9090
.. caution::
9191

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`.
9699

97100
.. code-block:: php
98101
@@ -225,18 +228,16 @@ Your job is to create a class that implements the interface and fill in its
225228
two methods: ``getController`` and ``getArguments``. In fact, one default
226229
implementation already exists, which you can use directly or learn from:
227230
: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.
230232

231233
.. caution::
232234

233-
The `getArguments()` method in the :class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolver`
235+
The ``getArguments()`` method in the :class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolver`
234236
and respective interface :class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolverInterface`
235237
are deprecated as of 3.1 and will be removed in 4.0. You can use the
236238
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolver` which uses the
237239
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolverInterface` instead.
238240

239-
240241
.. code-block:: php
241242
242243
namespace Symfony\Component\HttpKernel\Controller;
@@ -363,9 +364,9 @@ of arguments that should be passed when executing that callable.
363364
from the ``RouterListener``).
364365

365366
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``.
369370

370371
c) If the function or method argument is `variadic`_ and the ``Request``
371372
``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
652653
:class:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface` and
653654
use any argument resolver that implements the
654655
: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
656657
else that can be used to create a working example::
657658

658659
use Symfony\Component\EventDispatcher\EventDispatcher;

create_framework/http_kernel_controller_resolver.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,22 @@ component:
4444
$ composer require symfony/http-kernel
4545
4646
The HttpKernel component has many interesting features, but the ones we need
47-
right now are the *controller resolver* and *argument resolver*. A controller resolver knows how to
48-
determine the controller to execute and the argument resolver determines the arguments to pass to it,
49-
based on a Request object. All controller resolvers implement the following interface
47+
right now are the *controller resolver* and *argument resolver*. A controller
48+
resolver knows how to determine the controller to execute and the argument
49+
resolver determines the arguments to pass to it. All controller resolvers
50+
implement the following interface:
5051

5152
.. caution::
5253

53-
The `getArguments()` method in the :class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolver`
54-
and respective interface :class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolverInterface`
54+
The ``getArguments()`` method in the
55+
:class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolver`
56+
and respective interface
57+
:class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolverInterface`
5558
are deprecated as of 3.1 and will be removed in 4.0. You can use the
56-
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolver` which uses the
57-
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolverInterface` instead.
59+
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolver`
60+
which uses the
61+
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolverInterface`
62+
instead.
5863

5964
.. code-block:: php
6065

0 commit comments

Comments
 (0)