From 005e7551584629052aca622bdb48d78a8f3b0644 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 16 Mar 2021 10:38:11 +0100 Subject: [PATCH] PSR 2 compliance --- src/Authenticator/LoginFormAuthenticator.php | 2 -- .../Account/AccountAdminController.php | 6 +++--- src/Controller/Auth/AuthController.php | 20 ++++++++----------- .../Dashboard/DashboardAdminController.php | 2 +- src/Entity/User.php | 4 ++-- src/Event/Account/PasswordRequestEvent.php | 2 +- .../EntityManager/EntityManagerEvent.php | 2 +- .../AccountPasswordRequestEventSubscriber.php | 5 ++--- .../EntityManagerEventSubscriber.php | 2 +- 9 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/Authenticator/LoginFormAuthenticator.php b/src/Authenticator/LoginFormAuthenticator.php index 768e245..963ca46 100644 --- a/src/Authenticator/LoginFormAuthenticator.php +++ b/src/Authenticator/LoginFormAuthenticator.php @@ -2,7 +2,6 @@ namespace App\Authenticator; - use App\Entity\User; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -95,4 +94,3 @@ class LoginFormAuthenticator extends AbstractFormLoginAuthenticator return $this->urlGenerator->generate('auth_login'); } } - diff --git a/src/Controller/Account/AccountAdminController.php b/src/Controller/Account/AccountAdminController.php index c9a28ad..b72c9fb 100644 --- a/src/Controller/Account/AccountAdminController.php +++ b/src/Controller/Account/AccountAdminController.php @@ -2,6 +2,8 @@ namespace App\Controller\Account; +use App\Controller\Admin\AdminController; +use App\Manager\EntityManager; use App\Repository\UserRepository; use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface; use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface as TotpAuthenticatorInterface; @@ -9,10 +11,8 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; -use ZxcvbnPhp\Zxcvbn; use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface; -use App\Controller\Admin\AdminController; -use App\Manager\EntityManager; +use ZxcvbnPhp\Zxcvbn; /** * @Route("/admin/account") diff --git a/src/Controller/Auth/AuthController.php b/src/Controller/Auth/AuthController.php index e5401df..8d98b91 100644 --- a/src/Controller/Auth/AuthController.php +++ b/src/Controller/Auth/AuthController.php @@ -2,20 +2,18 @@ namespace App\Controller\Auth; +use App\Event\Account\PasswordRequestEvent; +use App\Manager\EntityManager; use App\Repository\UserRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; -use App\Notification\MailNotifier; -use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface; -use ZxcvbnPhp\Zxcvbn; use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; -use App\Manager\EntityManager; -use App\Event\Account\PasswordRequestEvent; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface; +use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; +use ZxcvbnPhp\Zxcvbn; class AuthController extends AbstractController { @@ -46,8 +44,7 @@ class AuthController extends AbstractController TokenGeneratorInterface $tokenGenerator, EntityManager $entityManager, EventDispatcherInterface $eventDispatcher - ): Response - { + ): Response { if ($this->getUser()) { return $this->redirectToRoute('admin_dashboard_index'); } @@ -99,8 +96,7 @@ class AuthController extends AbstractController TokenGeneratorInterface $tokenGenerator, UserPasswordEncoderInterface $encoder, EntityManager $entityManager - ): Response - { + ): Response { if ($this->getUser()) { return $this->redirectToRoute('index'); } diff --git a/src/Controller/Dashboard/DashboardAdminController.php b/src/Controller/Dashboard/DashboardAdminController.php index 98c49ba..d468166 100644 --- a/src/Controller/Dashboard/DashboardAdminController.php +++ b/src/Controller/Dashboard/DashboardAdminController.php @@ -2,9 +2,9 @@ namespace App\Controller\Dashboard; +use App\Controller\Admin\AdminController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -use App\Controller\Admin\AdminController; /** * @Route("/admin") diff --git a/src/Entity/User.php b/src/Entity/User.php index 016d3ea..cb6af78 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -4,9 +4,9 @@ namespace App\Entity; use App\Repository\UserRepository; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Security\Core\User\UserInterface; -use Scheb\TwoFactorBundle\Model\Totp\TotpConfiguration; use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface; +use Scheb\TwoFactorBundle\Model\Totp\TotpConfiguration; +use Symfony\Component\Security\Core\User\UserInterface; /** * @ORM\Entity(repositoryClass=UserRepository::class) diff --git a/src/Event/Account/PasswordRequestEvent.php b/src/Event/Account/PasswordRequestEvent.php index 5b6ee6a..5dd075d 100644 --- a/src/Event/Account/PasswordRequestEvent.php +++ b/src/Event/Account/PasswordRequestEvent.php @@ -2,8 +2,8 @@ namespace App\Event\Account; -use Symfony\Contracts\EventDispatcher\Event; use App\Entity\User; +use Symfony\Contracts\EventDispatcher\Event; /** * class PasswordRequestEvent. diff --git a/src/Event/EntityManager/EntityManagerEvent.php b/src/Event/EntityManager/EntityManagerEvent.php index 04c12a1..f858324 100644 --- a/src/Event/EntityManager/EntityManagerEvent.php +++ b/src/Event/EntityManager/EntityManagerEvent.php @@ -2,8 +2,8 @@ namespace App\Event\EntityManager; -use Symfony\Contracts\EventDispatcher\Event; use App\Entity\Entity; +use Symfony\Contracts\EventDispatcher\Event; /** * class EntityEvent. diff --git a/src/EventSuscriber/AccountPasswordRequestEventSubscriber.php b/src/EventSuscriber/AccountPasswordRequestEventSubscriber.php index f0c45d5..3d81039 100644 --- a/src/EventSuscriber/AccountPasswordRequestEventSubscriber.php +++ b/src/EventSuscriber/AccountPasswordRequestEventSubscriber.php @@ -2,11 +2,10 @@ namespace App\EventSuscriber; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use App\Event\EntityManager\EntityManagerEvent; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use App\Event\Account\PasswordRequestEvent; use App\Notification\MailNotifier; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** * class EventListener. diff --git a/src/EventSuscriber/EntityManagerEventSubscriber.php b/src/EventSuscriber/EntityManagerEventSubscriber.php index 4b343e1..6044a30 100644 --- a/src/EventSuscriber/EntityManagerEventSubscriber.php +++ b/src/EventSuscriber/EntityManagerEventSubscriber.php @@ -2,8 +2,8 @@ namespace App\EventSuscriber; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; use App\Event\EntityManager\EntityManagerEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * class EventListener.