Skip to content

Commit db2b507

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Minor change in description Using const `Response::HTTP_MOVED_PERMANENTLY` for redirect Fix broken AuthenticationSuccessEvent event link Update doctrine.rst
2 parents 89f89f7 + ab60c44 commit db2b507

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

controller.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ If you want to redirect the user to another page, use the ``redirectToRoute()``
132132
and ``redirect()`` methods::
133133

134134
use Symfony\Component\HttpFoundation\RedirectResponse;
135+
use Symfony\Component\HttpFoundation\Response
135136

136137
// ...
137138
public function index(): RedirectResponse
@@ -142,8 +143,10 @@ and ``redirect()`` methods::
142143
// redirectToRoute is a shortcut for:
143144
// return new RedirectResponse($this->generateUrl('homepage'));
144145

145-
// does a permanent - 301 redirect
146+
// does a permanent HTTP 301 redirect
146147
return $this->redirectToRoute('homepage', [], 301);
148+
// if you prefer, you can use PHP constants instead of hardcoded numbers
149+
return $this->redirectToRoute('homepage', [], Response::HTTP_MOVED_PERMANENTLY);
147150

148151
// redirect to a route with parameters
149152
return $this->redirectToRoute('app_lucky_number', ['max' => 10]);

doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ and save it::
361361

362362
// ...
363363
use App\Entity\Product;
364-
use Doctrine\ORM\EntityManagerInterface;
364+
use Doctrine\Persistence\ManagerRegistry;
365365
use Symfony\Component\HttpFoundation\Response;
366366

367367
class ProductController extends AbstractController

event_dispatcher.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ listener class:
118118
#. If the ``kernel.event_listener`` tag defines the ``method`` attribute, that's
119119
the name of the method to be called;
120120
#. If no ``method`` attribute is defined, try to call the method whose name
121-
is ``on`` + "camel-cased event name" (e.g. ``onKernelException()`` method for
121+
is ``on`` + "PascalCased event name" (e.g. ``onKernelException()`` method for
122122
the ``kernel.exception`` event);
123123
#. If that method is not defined either, try to call the ``__invoke()`` magic
124124
method (which makes event listeners invokable);

security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2523,7 +2523,7 @@ Authentication Events
25232523
where you need to modify the created token (e.g. for multi factor
25242524
authentication).
25252525

2526-
:class:`Symfony\\Component\\Security\\Http\\Event\\AuthenticationSuccessEvent`
2526+
:class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationSuccessEvent`
25272527
Dispatched when authentication is nearing success. This is the last
25282528
event that can make an authentication fail by throwing an
25292529
``AuthenticationException``.

0 commit comments

Comments
 (0)