Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
88.89% covered (warning)
88.89%
8 / 9
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
SecurityController
88.89% covered (warning)
88.89%
8 / 9
66.67% covered (warning)
66.67%
2 / 3
3.01
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 login
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
 logout
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace App\Controller\Security;
6
7use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8use Symfony\Component\HttpFoundation\Response;
9use Symfony\Component\Routing\Attribute\Route;
10use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
11
12class SecurityController extends AbstractController
13{
14    public function __construct(private readonly AuthenticationUtils $authenticationUtils) {}
15
16    #[Route(path: '/login', name: 'login', methods: ['GET', 'POST'])]
17    public function login(): Response
18    {
19        return $this->render(
20            'auth/login.html.twig',
21            [
22                'last_username' => $this->authenticationUtils->getLastUsername(),
23                'error' => $this->authenticationUtils->getLastAuthenticationError(),
24            ]
25        );
26    }
27
28    #[Route(path: '/logout', name: 'logout', methods: ['GET'])]
29    public function logout(): void {}
30}