Skip to content

Commit b046f5a

Browse files
committed
-
1 parent 0c35171 commit b046f5a

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

session.rst

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,21 @@ if you type-hint an argument with :class:`Symfony\\Component\\HttpFoundation\\Re
7171
$session = new Session();
7272
$session->start();
7373
74-
From a Symfony controller, type-hint an argument with
75-
:class:`Symfony\\Component\\HttpFoundation\\RequestStack` or
74+
From a Symfony controller, you can also type-hint an argument with
7675
:class:`Symfony\\Component\\HttpFoundation\\Request`::
7776

7877
use Symfony\Component\HttpFoundation\Request;
79-
use Symfony\Component\HttpFoundation\RequestStack;
8078
use Symfony\Component\HttpFoundation\Response;
8179

82-
public function index(RequestStack $requestStack): Response
83-
{
84-
$session = $requestStack->getSession();
85-
86-
// ...
87-
}
88-
8980
public function index(Request $request): Response
9081
{
9182
$session = $request->getSession();
9283

9384
// ...
9485
}
9586

96-
Attributes
97-
----------
87+
Session Attributes
88+
------------------
9889

9990
PHP's session management requires the use of the ``$_SESSION`` super-global.
10091
However, this interferes with code testability and encapsulation in an OOP
@@ -1363,7 +1354,7 @@ Session Proxies
13631354
---------------
13641355

13651356
The session proxy mechanism has a variety of uses and this article demonstrates
1366-
two common uses. Rather than using the regular session handler, you can create
1357+
two common ones. Rather than using the regular session handler, you can create
13671358
a custom save handler by defining a class that extends the
13681359
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy`
13691360
class.

0 commit comments

Comments
 (0)