vendor/sonata-project/user-bundle/src/Controller/AdminResettingController.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of the Sonata Project package.
  5.  *
  6.  * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace Sonata\UserBundle\Controller;
  12. // NEXT_MAJOR: remove this file
  13. @trigger_error(
  14.     'The '.__NAMESPACE__.'\AdminResettingController class is deprecated since version 4.3.0 and will be removed in 5.0.'
  15.     .' Use '.__NAMESPACE__.'\RequestAction, '.__NAMESPACE__.'\CheckEmailAction, '.__NAMESPACE__.'\ResetAction or '.__NAMESPACE__.'\SendEmailAction instead.',
  16.     E_USER_DEPRECATED
  17. );
  18. use Sonata\UserBundle\Action\CheckEmailAction;
  19. use Sonata\UserBundle\Action\RequestAction;
  20. use Sonata\UserBundle\Action\ResetAction;
  21. use Sonata\UserBundle\Action\SendEmailAction;
  22. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  23. use Symfony\Component\HttpFoundation\Request;
  24. use Symfony\Component\HttpFoundation\Response;
  25. class AdminResettingController extends Controller
  26. {
  27.     /**
  28.      * @return Response
  29.      */
  30.     public function requestAction()
  31.     {
  32.         /** @var RequestAction $requestAction */
  33.         $requestAction $this->container->get(RequestAction::class);
  34.         return $requestAction($this->getCurrentRequest());
  35.     }
  36.     /**
  37.      * @return Response
  38.      */
  39.     public function sendEmailAction(Request $request)
  40.     {
  41.         /** @var SendEmailAction $sendEmailAction */
  42.         $sendEmailAction $this->container->get(SendEmailAction::class);
  43.         return $sendEmailAction($this->getCurrentRequest());
  44.     }
  45.     /**
  46.      * @return Response
  47.      */
  48.     public function checkEmailAction(Request $request)
  49.     {
  50.         /** @var CheckEmailAction $checkEmailAction */
  51.         $checkEmailAction $this->container->get(CheckEmailAction::class);
  52.         return $checkEmailAction($this->getCurrentRequest());
  53.     }
  54.     /**
  55.      * @return Response
  56.      */
  57.     public function resetAction(Request $requeststring $token)
  58.     {
  59.         /** @var ResetAction $resetAction */
  60.         $resetAction $this->container->get(ResetAction::class);
  61.         return $resetAction($this->getCurrentRequest(), $token);
  62.     }
  63.     private function getCurrentRequest(): Request
  64.     {
  65.         return $this->container->get('request_stack')->getCurrentRequest();
  66.     }
  67. }