Skip to content

Commit df678e5

Browse files
committed
minor #17386 [Security] Fix the SecurityBundle\Security.php helper namespace (smnandre)
This PR was merged into the 6.2 branch. Discussion ---------- [Security] Fix the SecurityBundle\Security.php helper namespace This PR fix the new `Security` helper namespace change introduced by this PR: symfony/symfony#47760 (itself following #17284) Targeting 6.2 because the Security Helper class did not exists there before Commits ------- f1467e7 Fix the Security\Helper namespace
2 parents 259530a + f1467e7 commit df678e5

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

form/dynamic_form_modification.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The problem is now to get the current user and create a choice field that
233233
contains only this user's friends. This can be done by injecting the ``Security``
234234
service into the form type so you can get the current user object::
235235

236-
use Symfony\Bundle\SecurityBundle\Security\Security;
236+
use Symfony\Bundle\SecurityBundle\Security;
237237
// ...
238238

239239
class FriendMessageFormType extends AbstractType
@@ -260,7 +260,7 @@ security helper to fill in the listener logic::
260260
use App\Entity\User;
261261
use Doctrine\ORM\EntityRepository;
262262
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
263-
use Symfony\Bundle\SecurityBundle\Security\Security;
263+
use Symfony\Bundle\SecurityBundle\Security;
264264
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
265265
use Symfony\Component\Form\Extension\Core\Type\TextType;
266266
// ...

security.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -598,12 +598,12 @@ Fetching the Firewall Configuration for a Request
598598
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
599599

600600
If you need to get the configuration of the firewall that matched a given request,
601-
use the :class:`Symfony\\Bundle\\SecurityBundle\\Security\\Security` service::
601+
use the :class:`Symfony\\Bundle\\SecurityBundle\\Security` service::
602602

603603
// src/Service/ExampleService.php
604604
// ...
605605

606-
use Symfony\Bundle\SecurityBundle\Security\Security;
606+
use Symfony\Bundle\SecurityBundle\Security;
607607
use Symfony\Component\HttpFoundation\RequestStack;
608608

609609
class ExampleService
@@ -1609,23 +1609,23 @@ Login Programmatically
16091609

16101610
.. versionadded:: 6.2
16111611

1612-
The :class:`Symfony\Bundle\SecurityBundle\Security\Security <Symfony\\Bundle\\SecurityBundle\\Security\\Security>`
1612+
The :class:`Symfony\Bundle\SecurityBundle\Security <Symfony\\Bundle\\SecurityBundle\\Security>`
16131613
class was introduced in Symfony 6.2. Prior to 6.2, it was called
16141614
``Symfony\Component\Security\Core\Security``.
16151615

16161616
.. versionadded:: 6.2
16171617

1618-
The :method:`Symfony\\Bundle\\SecurityBundle\\Security\\Security::login`
1618+
The :method:`Symfony\\Bundle\\SecurityBundle\\Security::login`
16191619
method was introduced in Symfony 6.2.
16201620

16211621
You can log in a user programmatically using the `login()` method of the
1622-
:class:`Symfony\\Bundle\\SecurityBundle\\Security\\Security` helper::
1622+
:class:`Symfony\\Bundle\\SecurityBundle\\Security` helper::
16231623

16241624
// src/Controller/SecurityController.php
16251625
namespace App\Controller\SecurityController;
16261626

16271627
use App\Security\Authenticator\ExampleAuthenticator;
1628-
use Symfony\Bundle\SecurityBundle\Security\Security;
1628+
use Symfony\Bundle\SecurityBundle\Security;
16291629

16301630
class SecurityController
16311631
{
@@ -1779,22 +1779,22 @@ Logout programmatically
17791779

17801780
.. versionadded:: 6.2
17811781

1782-
The :class:`Symfony\Bundle\SecurityBundle\Security\Security <Symfony\\Bundle\\SecurityBundle\\Security\\Security>`
1782+
The :class:`Symfony\Bundle\SecurityBundle\Security <Symfony\\Bundle\\SecurityBundle\\Security>`
17831783
class was introduced in Symfony 6.2. Prior to 6.2, it was called
17841784
``Symfony\Component\Security\Core\Security``.
17851785

17861786
.. versionadded:: 6.2
17871787

1788-
The :method:`Symfony\\Bundle\\SecurityBundle\\Security\\Security::logout`
1788+
The :method:`Symfony\\Bundle\\SecurityBundle\\Security::logout`
17891789
method was introduced in Symfony 6.2.
17901790

17911791
You can logout user programmatically using the ``logout()`` method of the
1792-
:class:`Symfony\\Bundle\\SecurityBundle\\Security\\Security` helper::
1792+
:class:`Symfony\\Bundle\\SecurityBundle\\Security` helper::
17931793

17941794
// src/Controller/SecurityController.php
17951795
namespace App\Controller\SecurityController;
17961796

1797-
use Symfony\Bundle\SecurityBundle\Security\Security;
1797+
use Symfony\Bundle\SecurityBundle\Security;
17981798

17991799
class SecurityController
18001800
{
@@ -1896,12 +1896,12 @@ Fetching the User from a Service
18961896
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18971897

18981898
If you need to get the logged in user from a service, use the
1899-
:class:`Symfony\\Bundle\\SecurityBundle\\Security\\Security` service::
1899+
:class:`Symfony\\Bundle\\SecurityBundle\\Security` service::
19001900

19011901
// src/Service/ExampleService.php
19021902
// ...
19031903

1904-
use Symfony\Bundle\SecurityBundle\Security\Security;
1904+
use Symfony\Bundle\SecurityBundle\Security;
19051905

19061906
class ExampleService
19071907
{
@@ -1925,7 +1925,7 @@ If you need to get the logged in user from a service, use the
19251925

19261926
.. versionadded:: 6.2
19271927

1928-
The :class:`Symfony\\Bundle\\SecurityBundle\\Security\\Security` class
1928+
The :class:`Symfony\\Bundle\\SecurityBundle\\Security` class
19291929
was introduced in Symfony 6.2. In previous Symfony versions this class was
19301930
defined in ``Symfony\Component\Security\Core\Security``.
19311931

@@ -2333,7 +2333,7 @@ want to include extra details only for users that have a ``ROLE_SALES_ADMIN`` ro
23332333
23342334
// ...
23352335
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
2336-
+ use Symfony\Bundle\SecurityBundle\Security\Security;
2336+
+ use Symfony\Bundle\SecurityBundle\Security;
23372337
23382338
class SalesReportManager
23392339
{

security/impersonating_user.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ the impersonator user::
160160
// src/Service/SomeService.php
161161
namespace App\Service;
162162

163-
use Symfony\Bundle\SecurityBundle\Security\Security;
163+
use Symfony\Bundle\SecurityBundle\Security;
164164
use Symfony\Component\Security\Core\Authentication\Token\SwitchUserToken;
165165
// ...
166166

@@ -367,7 +367,7 @@ logic you want::
367367
// src/Security/Voter/SwitchToCustomerVoter.php
368368
namespace App\Security\Voter;
369369

370-
use Symfony\Bundle\SecurityBundle\Security\Security;
370+
use Symfony\Bundle\SecurityBundle\Security;
371371
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
372372
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
373373
use Symfony\Component\Security\Core\User\UserInterface;

security/voters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ with ``ROLE_SUPER_ADMIN``::
222222
// src/Security/PostVoter.php
223223

224224
// ...
225-
use Symfony\Bundle\SecurityBundle\Security\Security;
225+
use Symfony\Bundle\SecurityBundle\Security;
226226

227227
class PostVoter extends Voter
228228
{

session/proxy_examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ can intercept the session before it is written::
110110
namespace App\Session;
111111

112112
use App\Entity\User;
113-
use Symfony\Bundle\SecurityBundle\Security\Security;
113+
use Symfony\Bundle\SecurityBundle\Security;
114114
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
115115

116116
class ReadOnlySessionProxy extends SessionHandlerProxy

0 commit comments

Comments
 (0)