Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3dac1e4

Browse files
IonBazanchalasr
authored andcommitted
Point Security::* constants to SecurityRequestAttributes::* ones
1 parent 78408a4 commit 3dac1e4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Symfony/Bundle/SecurityBundle/Security.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
2525
use Symfony\Component\Security\Http\Event\LogoutEvent;
2626
use Symfony\Component\Security\Http\ParameterBagUtils;
27+
use Symfony\Component\Security\Http\SecurityRequestAttributes;
2728
use Symfony\Contracts\Service\ServiceProviderInterface;
2829

2930
/**
@@ -37,6 +38,11 @@
3738
*/
3839
class Security extends LegacySecurity
3940
{
41+
public const ACCESS_DENIED_ERROR = SecurityRequestAttributes::ACCESS_DENIED_ERROR;
42+
public const AUTHENTICATION_ERROR = SecurityRequestAttributes::AUTHENTICATION_ERROR;
43+
public const LAST_USERNAME = SecurityRequestAttributes::LAST_USERNAME;
44+
45+
4046
public function __construct(private readonly ContainerInterface $container, private readonly array $authenticators = [])
4147
{
4248
parent::__construct($container, false);

src/Symfony/Component/Security/Core/Security.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,16 @@ class Security implements AuthorizationCheckerInterface
2626
{
2727
/**
2828
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::ACCESS_DENIED_ERROR instead
29-
*
30-
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes::ACCESS_DENIED_ERROR.
3129
*/
3230
public const ACCESS_DENIED_ERROR = '_security.403_error';
3331

3432
/**
3533
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::AUTHENTICATION_ERROR instead
36-
*
37-
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes::AUTHENTICATION_ERROR.
3834
*/
3935
public const AUTHENTICATION_ERROR = '_security.last_error';
4036

4137
/**
4238
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::LAST_USERNAME instead
43-
*
44-
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes::LAST_USERNAME.
4539
*/
4640
public const LAST_USERNAME = '_security.last_username';
4741

0 commit comments

Comments
 (0)