vendor/nucleos/user-bundle/src/Action/RequestResetAction.php line 20

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the NucleosUserBundle package.
  4.  *
  5.  * (c) Christian Gripp <mail@core23.de>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Nucleos\UserBundle\Action;
  11. use Nucleos\UserBundle\Form\Type\RequestPasswordFormType;
  12. use Symfony\Component\Form\FormFactoryInterface;
  13. use Symfony\Component\HttpFoundation\Response;
  14. use Symfony\Component\Routing\RouterInterface;
  15. use Twig\Environment;
  16. final class RequestResetAction
  17. {
  18.     /**
  19.      * @var Environment
  20.      */
  21.     private $twig;
  22.     /**
  23.      * @var FormFactoryInterface
  24.      */
  25.     private $formFactory;
  26.     /**
  27.      * @var RouterInterface
  28.      */
  29.     private $router;
  30.     public function __construct(Environment $twigFormFactoryInterface $formFactoryRouterInterface $router)
  31.     {
  32.         $this->twig        $twig;
  33.         $this->formFactory $formFactory;
  34.         $this->router      $router;
  35.     }
  36.     public function __invoke(): Response
  37.     {
  38.         $form $this->formFactory->create(RequestPasswordFormType::class, null, [
  39.             'action' => $this->router->generate('nucleos_user_resetting_send_email'),
  40.             'method' => 'POST',
  41.         ]);
  42.         return new Response($this->twig->render('@NucleosUser/Resetting/request.html.twig', [
  43.             'form' => $form->createView(),
  44.         ]));
  45.     }
  46. }