Skip to content

Commit 53db097

Browse files
committed
minor #47760 Move the new Security helper to the root of SecurityBundle (wouterj)
This PR was merged into the 6.2 branch. Discussion ---------- Move the new Security helper to the root of SecurityBundle | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - While merging symfony/symfony-docs#17284 , I found this rather repeating FQCN: `...\SecurityBundle\Security\Security`. Security is important, but let's move the class (also introduced in 6.2) one level up to make the FQCN not unnecessarily long. Commits ------- 472544e Move the new Security helper to the root of SecurityBundle
2 parents f82b2c4 + 472544e commit 53db097

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CHANGELOG
55
---
66

77
* Add the `Security` helper class
8-
* Deprecate the `Symfony\Component\Security\Core\Security` service alias, use `Symfony\Bundle\SecurityBundle\Security\Security` instead
8+
* Deprecate the `Symfony\Component\Security\Core\Security` service alias, use `Symfony\Bundle\SecurityBundle\Security` instead
99
* Add `Security::getFirewallConfig()` to help to get the firewall configuration associated to the Request
1010
* Add `Security::login()` to login programmatically
1111
* Add `Security::logout()` to logout programmatically

src/Symfony/Bundle/SecurityBundle/Resources/config/security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
use Symfony\Bundle\SecurityBundle\CacheWarmer\ExpressionCacheWarmer;
1515
use Symfony\Bundle\SecurityBundle\EventListener\FirewallListener;
16+
use Symfony\Bundle\SecurityBundle\Security;
1617
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
1718
use Symfony\Bundle\SecurityBundle\Security\FirewallContext;
1819
use Symfony\Bundle\SecurityBundle\Security\FirewallMap;
1920
use Symfony\Bundle\SecurityBundle\Security\LazyFirewallContext;
20-
use Symfony\Bundle\SecurityBundle\Security\Security;
2121
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
2222
use Symfony\Component\Ldap\Security\LdapUserProvider;
2323
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;

src/Symfony/Bundle/SecurityBundle/Security/Security.php renamed to src/Symfony/Bundle/SecurityBundle/Security.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Bundle\SecurityBundle\Security;
12+
namespace Symfony\Bundle\SecurityBundle;
1313

1414
use Psr\Container\ContainerInterface;
15+
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
1516
use Symfony\Component\HttpFoundation\Request;
1617
use Symfony\Component\HttpFoundation\Response;
1718
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
1313

14+
use Symfony\Bundle\SecurityBundle\Security;
1415
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
15-
use Symfony\Bundle\SecurityBundle\Security\Security;
1616
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\SecuredPageBundle\Security\Core\User\ArrayUserProvider;
1717
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1818
use Symfony\Component\HttpFoundation\JsonResponse;

src/Symfony/Bundle/SecurityBundle/Tests/Security/SecurityTest.php renamed to src/Symfony/Bundle/SecurityBundle/Tests/SecurityTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Bundle\SecurityBundle\Tests\Security;
12+
namespace Symfony\Bundle\SecurityBundle\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Psr\Container\ContainerInterface;
16+
use Symfony\Bundle\SecurityBundle\Security;
1617
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
1718
use Symfony\Bundle\SecurityBundle\Security\FirewallMap;
18-
use Symfony\Bundle\SecurityBundle\Security\Security;
1919
use Symfony\Component\DependencyInjection\ServiceLocator;
2020
use Symfony\Component\HttpFoundation\Request;
2121
use Symfony\Component\HttpFoundation\RequestStack;

src/Symfony/Component/Security/Core/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
6.2
55
---
66

7-
* Deprecate the `Security` class, use `Symfony\Bundle\SecurityBundle\Security\Security` instead
7+
* Deprecate the `Security` class, use `Symfony\Bundle\SecurityBundle\Security` instead
88
* Change the signature of `TokenStorageInterface::setToken()` to `setToken(?TokenInterface $token)`
99
* Deprecate calling `TokenStorage::setToken()` without arguments
1010
* Add a `ChainUserChecker` to allow calling multiple user checkers for a firewall

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@
1212
namespace Symfony\Component\Security\Core;
1313

1414
use Psr\Container\ContainerInterface;
15-
use Symfony\Bundle\SecurityBundle\Security\Security as NewSecurityHelper;
15+
use Symfony\Bundle\SecurityBundle\Security as NewSecurityHelper;
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1717
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
1818
use Symfony\Component\Security\Core\User\UserInterface;
1919

2020
/**
2121
* Helper class for commonly-needed security tasks.
2222
*
23-
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security\Security instead
23+
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security instead
2424
*/
2525
class Security implements AuthorizationCheckerInterface
2626
{
2727
/**
28-
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security\Security::ACCESS_DENIED_ERROR instead
28+
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::ACCESS_DENIED_ERROR instead
2929
*
3030
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes:ACCESS_DENIED_ERROR.
3131
*/
3232
public const ACCESS_DENIED_ERROR = '_security.403_error';
3333

3434
/**
35-
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security\Security::AUTHENTICATION_ERROR instead
35+
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::AUTHENTICATION_ERROR instead
3636
*
3737
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes:AUTHENTICATION_ERROR.
3838
*/
3939
public const AUTHENTICATION_ERROR = '_security.last_error';
4040

4141
/**
42-
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security\Security::LAST_USERNAME instead
42+
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::LAST_USERNAME instead
4343
*
4444
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes:LAST_USERNAME.
4545
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy