Skip to content

Commit d6474fc

Browse files
committed
Merge branch '2.4'
2 parents a9648e8 + e28d0cb commit d6474fc

File tree

9 files changed

+412
-27
lines changed

9 files changed

+412
-27
lines changed

book/security.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ Next, create the controller that will display the login form::
438438

439439
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
440440
use Symfony\Component\HttpFoundation\Request;
441-
use Symfony\Component\Security\Core\SecurityContext;
441+
use Symfony\Component\Security\Core\SecurityContextInterface;
442442

443443
class SecurityController extends Controller
444444
{
@@ -447,20 +447,20 @@ Next, create the controller that will display the login form::
447447
$session = $request->getSession();
448448

449449
// get the login error if there is one
450-
if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
450+
if ($request->attributes->has(SecurityContextInterface::AUTHENTICATION_ERROR)) {
451451
$error = $request->attributes->get(
452-
SecurityContext::AUTHENTICATION_ERROR
452+
SecurityContextInterface::AUTHENTICATION_ERROR
453453
);
454454
} else {
455-
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
456-
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
455+
$error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
456+
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
457457
}
458458

459459
return $this->render(
460460
'AcmeSecurityBundle:Security:login.html.twig',
461461
array(
462462
// last username entered by the user
463-
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
463+
'last_username' => $session->get(SecurityContextInterface::LAST_USERNAME),
464464
'error' => $error,
465465
)
466466
);

components/dependency_injection/factories.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class:
7979
8080
When you specify the class to use for the factory (via ``factory_class``)
8181
the method will be called statically. If the factory itself should be instantiated
82-
and the resulting object's method called (as in this example), configure the
83-
factory itself as a service:
82+
and the resulting object's method called, configure the factory itself as a service.
83+
In this case, the method (e.g. get) should be changed to be non-static:
8484

8585
.. configuration-block::
8686

0 commit comments

Comments
 (0)