Skip to content

Commit f95209f

Browse files
committed
feature #8636 Removed deprecations for argument/controller resolvers (iltar)
This PR was merged into the master branch. Discussion ---------- Removed deprecations for argument/controller resolvers I've removed the deprecation mentions and updated some text/examples to be correct for 4.0. Closes #8626. Commits ------- 3b27a3d Removed deprecations for argument/controller resolvers
2 parents 6c1a99a + 3b27a3d commit f95209f

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

components/http_kernel.rst

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ and is one of the constructor arguments to ``HttpKernel``.
220220
:align: center
221221

222222
Your job is to create a class that implements the interface and fill in its
223-
two methods: ``getController()`` and ``getArguments()``. In fact, one default
224-
implementation already exists, which you can use directly or learn from:
223+
method: ``getController()``. In fact, one default implementation already
224+
exists, which you can use directly or learn from:
225225
:class:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver`.
226226
This implementation is explained more in the sidebar below::
227227

@@ -232,30 +232,15 @@ This implementation is explained more in the sidebar below::
232232
interface ControllerResolverInterface
233233
{
234234
public function getController(Request $request);
235-
236-
public function getArguments(Request $request, $controller);
237235
}
238236

239-
.. caution::
240-
241-
The ``getArguments()`` method in the
242-
:class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolver` and
243-
respective interface
244-
:class:`Symfony\\Component\\Httpkernel\\Controller\\ControllerResolverInterface`
245-
are deprecated as of 3.1 and will be removed in 4.0. You can use the
246-
:class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolver` which
247-
uses the :class:`Symfony\\Component\\Httpkernel\\Controller\\ArgumentResolverInterface`
248-
instead.
249237

250238
Internally, the ``HttpKernel::handle()`` method first calls
251239
:method:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface::getController`
252240
on the controller resolver. This method is passed the ``Request`` and is responsible
253241
for somehow determining and returning a PHP callable (the controller) based
254242
on the request's information.
255243

256-
The second method, :method:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolverInterface::getArguments`,
257-
will be called after another event - ``kernel.controller`` - is dispatched.
258-
259244
.. sidebar:: Resolving the Controller in the Symfony Framework
260245

261246
The Symfony Framework uses the built-in

create_framework/http_kernel_controller_resolver.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,9 @@ based on a Request object. All controller resolvers implement the following inte
5353
// ...
5454
interface ControllerResolverInterface
5555
{
56-
function getController(Request $request);
57-
58-
function getArguments(Request $request, $controller);
56+
public function getController(Request $request);
5957
}
6058

61-
.. caution::
62-
63-
The ``getArguments()`` method is deprecated as of Symfony 3.1. and will be
64-
removed in 4.0. You can use the
65-
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver` which
66-
uses the :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolverInterface`
67-
instead.
6859

6960
The ``getController()`` method relies on the same convention as the one we
7061
have defined earlier: the ``_controller`` request attribute must contain the
@@ -98,7 +89,17 @@ resolver from HttpKernel::
9889

9990
Now, let's see how the controller arguments are guessed. ``getArguments()``
10091
introspects the controller signature to determine which arguments to pass to
101-
it by using the native PHP `reflection`_.
92+
it by using the native PHP `reflection`_. This method is defined in the
93+
following interface::
94+
95+
namespace Symfony\Component\HttpKernel\Controller;
96+
97+
// ...
98+
interface ArgumentResolverInterface
99+
{
100+
public function getArguments(Request $request, $controller);
101+
}
102+
102103

103104
The ``indexAction()`` method needs the Request object as an argument.
104105
``getArguments()`` knows when to inject it properly if it is type-hinted

0 commit comments

Comments
 (0)