Skip to content

Commit 9488607

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Fix missing namespace and other wrong wording from Security and Serializer context
2 parents 2dc5cd1 + a20f40a commit 9488607

11 files changed

+29
-3
lines changed

security/access_denied_handler.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This interface defines one method called ``handle()`` where you can implement wh
1313
logic that should run when access is denied for the current user (e.g. send a
1414
mail, log a message, or generally return a custom response)::
1515

16+
// src/Security/AccessDeniedHandler.php
1617
namespace App\Security;
1718

1819
use Symfony\Component\HttpFoundation\Request;

security/csrf.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ protected against CSRF attacks.
8383
By default Symfony adds the CSRF token in a hidden field called ``_token``, but
8484
this can be customized on a form-by-form basis::
8585

86+
// src/Form/TaskType.php
87+
namespace App\Form;
88+
8689
// ...
8790
use App\Entity\Task;
8891
use Symfony\Component\OptionsResolver\OptionsResolver;

security/custom_authentication_provider.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,11 @@ can have different timeout lengths.
541541
You will first need to edit ``WsseFactory`` and define the new option in
542542
the ``addConfiguration()`` method::
543543

544+
// src/DependencyInjection/Security/Factory/WsseFactory.php
545+
namespace App\DependencyInjection\Security\Factory;
546+
547+
// ...
548+
544549
class WsseFactory implements SecurityFactoryInterface
545550
{
546551
// ...
@@ -559,6 +564,9 @@ contain a ``lifetime`` key, set to 5 minutes (300 seconds) unless otherwise
559564
set in the configuration. Pass this argument to your authentication provider
560565
in order to put it to use::
561566

567+
// src/DependencyInjection/Security/Factory/WsseFactory.php
568+
namespace App\DependencyInjection\Security\Factory;
569+
562570
use App\Security\Authentication\Provider\WsseProvider;
563571

564572
class WsseFactory implements SecurityFactoryInterface

security/form_login.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ configuration (``login``):
9696
.. code-block:: php-annotations
9797
9898
// src/Controller/SecurityController.php
99+
namespace App\Controller;
99100
100101
// ...
101102
use Symfony\Component\Routing\Annotation\Route;

security/form_login_setup.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ If you also want to apply this behavior to public pages, you can create an
481481
:doc:`event subscriber </event_dispatcher>` to set the target path manually
482482
whenever the user browses a page::
483483

484+
// src/EventSubscriber/RequestSubscriber.php
484485
namespace App\EventSubscriber;
485486

486487
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

security/guard_authentication.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ your ``User`` class (the ``make:entity`` command is a good way to do this):
3333
.. code-block:: diff
3434
3535
// src/Entity/User.php
36+
namespace App\Entity;
37+
3638
// ...
3739
3840
class User implements UserInterface
@@ -419,6 +421,8 @@ You can throw this from ``getCredentials()``, ``getUser()`` or ``checkCredential
419421
to cause a failure::
420422

421423
// src/Security/TokenAuthenticator.php
424+
namespace App\Security;
425+
422426
// ...
423427

424428
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
@@ -461,8 +465,9 @@ completes registration. To do that, use your authenticator and a service called
461465
``GuardAuthenticatorHandler``::
462466

463467
// src/Controller/RegistrationController.php
468+
namespace App\Controller;
469+
464470
// ...
465-
466471
use App\Security\LoginFormAuthenticator;
467472
use Symfony\Component\HttpFoundation\Request;
468473
use Symfony\Component\Security\Guard\GuardAuthenticatorHandler;

security/impersonating_user.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ stored in the token storage will be a ``SwitchUserToken`` instance. Use the
116116
following snippet to obtain the original token which gives you access to
117117
the impersonator user::
118118

119+
// src/Service/SomeService.php
120+
namespace App\Service;
121+
119122
use Symfony\Component\Security\Core\Authentication\Token\SwitchUserToken;
120123
use Symfony\Component\Security\Core\Security;
121124
// ...
@@ -263,6 +266,7 @@ be called):
263266
Then, create a voter class that responds to this role and includes whatever custom
264267
logic you want::
265268

269+
// src/Service/Voter/SwitchToCustomerVoter.php
266270
namespace App\Security\Voter;
267271

268272
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

security/json_login_setup.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The next step is to configure a route in your app matching this path:
6868
.. code-block:: php-annotations
6969
7070
// src/Controller/SecurityController.php
71+
namespace App\Controller;
7172
7273
// ...
7374
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

security/named_encoders.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ to use it, the class must implement
121121
The interface requires one method - ``getEncoderName()`` - which should return
122122
the name of the encoder to use::
123123

124-
// src/Acme/UserBundle/Entity/User.php
125-
namespace Acme\UserBundle\Entity;
124+
// src/Entity/User.php
125+
namespace App\Entity;
126126

127127
use Symfony\Component\Security\Core\Encoder\EncoderAwareInterface;
128128
use Symfony\Component\Security\Core\User\UserInterface;

serializer/custom_encoders.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Imagine you want to serialize and deserialize YAML. For that you'll have to
1919
create your own encoder that uses the
2020
:doc:`Yaml Component </components/yaml>`::
2121

22+
// src/Serializer/YamlEncoder.php
2223
namespace App\Serializer;
2324

2425
use Symfony\Component\Serializer\Encoder\DecoderInterface;

0 commit comments

Comments
 (0)