PSR 2 compliance
This commit is contained in:
parent
7497232a5a
commit
a7dc9a6189
|
@ -4,19 +4,18 @@ namespace App\Controller\User;
|
||||||
|
|
||||||
use App\Controller\Admin\AdminController;
|
use App\Controller\Admin\AdminController;
|
||||||
use App\Entity\User as Entity;
|
use App\Entity\User as Entity;
|
||||||
|
use App\Event\Account\PasswordRequestEvent;
|
||||||
use App\Factory\UserFactory as EntityFactory;
|
use App\Factory\UserFactory as EntityFactory;
|
||||||
use App\Form\UserType as EntityType;
|
use App\Form\UserType as EntityType;
|
||||||
use App\Manager\EntityManager;
|
use App\Manager\EntityManager;
|
||||||
use App\Repository\UserRepositoryQuery;
|
use App\Repository\Blog\PostRepositoryQuery;
|
||||||
use App\Repository\UserRepositoryQuery as RepositoryQuery;
|
use App\Repository\UserRepositoryQuery as RepositoryQuery;
|
||||||
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use App\Repository\Blog\PostRepositoryQuery;
|
|
||||||
use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface;
|
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|
||||||
use App\Event\Account\PasswordRequestEvent;
|
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
|
use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/admin/user")
|
* @Route("/admin/user")
|
||||||
|
@ -43,8 +42,7 @@ class UserAdminController extends AdminController
|
||||||
EntityManager $entityManager,
|
EntityManager $entityManager,
|
||||||
UserPasswordEncoderInterface $encoder,
|
UserPasswordEncoderInterface $encoder,
|
||||||
Request $request
|
Request $request
|
||||||
): Response
|
): Response {
|
||||||
{
|
|
||||||
$entity = $factory->create($this->getUser());
|
$entity = $factory->create($this->getUser());
|
||||||
$form = $this->createForm(EntityType::class, $entity);
|
$form = $this->createForm(EntityType::class, $entity);
|
||||||
|
|
||||||
|
@ -122,8 +120,7 @@ class UserAdminController extends AdminController
|
||||||
TokenGeneratorInterface $tokenGenerator,
|
TokenGeneratorInterface $tokenGenerator,
|
||||||
EventDispatcherInterface $eventDispatcher,
|
EventDispatcherInterface $eventDispatcher,
|
||||||
Request $request
|
Request $request
|
||||||
): Response
|
): Response {
|
||||||
{
|
|
||||||
if ($this->isCsrfTokenValid('resetting_request'.$entity->getId(), $request->request->get('_token'))) {
|
if ($this->isCsrfTokenValid('resetting_request'.$entity->getId(), $request->request->get('_token'))) {
|
||||||
$entity->setConfirmationToken($tokenGenerator->generateToken());
|
$entity->setConfirmationToken($tokenGenerator->generateToken());
|
||||||
$entity->setPasswordRequestedAt(new \DateTime('now'));
|
$entity->setPasswordRequestedAt(new \DateTime('now'));
|
||||||
|
|
|
@ -4,12 +4,12 @@ namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Validator\Constraints\Email;
|
use Symfony\Component\Validator\Constraints\Email;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
|
||||||
|
|
||||||
class UserType extends AbstractType
|
class UserType extends AbstractType
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,6 @@ class UserType extends AbstractType
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
namespace App\Repository\Blog;
|
namespace App\Repository\Blog;
|
||||||
|
|
||||||
use App\Entity\Blog\Category;
|
use App\Entity\Blog\Category;
|
||||||
|
use App\Entity\User;
|
||||||
use App\Repository\RepositoryQuery;
|
use App\Repository\RepositoryQuery;
|
||||||
use Knp\Component\Pager\PaginatorInterface;
|
use Knp\Component\Pager\PaginatorInterface;
|
||||||
use App\Entity\User;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class PostRepositoryQuery.
|
* class PostRepositoryQuery.
|
||||||
|
|
Loading…
Reference in a new issue