src/Action/User/Login/LoginFormAction.php line 12

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Action\User\Login;
  4. use App\Repository\User\UserRepositoryInterface;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  8. class LoginFormAction extends AbstractController
  9. {
  10.     public function __invoke(
  11.         UserRepositoryInterface $userRepository,
  12.         UrlGeneratorInterface $urlGenerator
  13.     ): Response {
  14.         if (null !== $this->getUser()) {
  15.             return $this->redirectToRoute('wiki.welcome');
  16.         }
  17.         return $this->render(view'@app/user/login/form.html.twig');
  18.     }
  19. }