8000 Fix missing namespace and other wrong wording · symfony/symfony-docs@0caada6 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0caada6

Browse files
author
gary houbre
committed
Fix missing namespace and other wrong wording
1 parent 707580e commit 0caada6

12 files changed

+33
-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/experimental_authenticators.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ the following badges are supported:
472472
For instance, if you want to add CSRF and password migration to your custom
473473
authenticator, you would initialize the passport like this::
474474

475+
// src/Service/LoginAuthenticator.php
476+
namespace App\Service;
477+
475478
// ...
476479
use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator;
477480
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\CsrfTokenBadge;

security/form_login.rst

Lines changed: 2 additions & 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;
@@ -146,6 +147,7 @@ configuration (``login``):
146147
Great! Next, add the logic to ``login()`` that displays the login form::
147148

148149
// src/Controller/SecurityController.php
150+
149151
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
150152

151153
public function login(AuthenticationUtils $authenticationUtils)

security/form_login_setup.rst

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

473+
// src/EventSubscriber/RequestSubscriber.php
473474
namespace App\EventSubscriber;
474475

475476
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
@@ -362,6 +364,8 @@ You can throw this from ``getCredentials()``, ``getUser()`` or ``checkCredential
362364
to cause a failure::
363365

364366
// src/Security/TokenAuthenticator.php
367+
namespace App\Security;
368+
365369
// ...
366370

367371
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
@@ -404,8 +408,9 @@ completes registration. To do that, use your authenticator and a service called
404408
``GuardAuthenticatorHandler``::
405409

406410
// src/Controller/RegistrationController.php
411+
namespace App\Controller;
412+
407413
// ...
408-
409414
use App\Security\LoginFormAuthenticator;
410415
use Symfony\Component\HttpFoundation\Request;
411416
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;

serializer/custom_normalizer.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ process. For that you'll have to create your own normalizer. But it's usually
1717
preferable to let Symfony normalize the object, then hook into the normalization
1818
to customize the normalized data. To do that, leverage the ``ObjectNormalizer``::
1919

20+
// src/Serializer/TopicNormalizer.php
2021
namespace App\Serializer;
2122

2223
use App\Entity\Topic;

0 commit comments

Comments
 (0)
0