Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
88.89% |
8 / 9 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| SecurityController | |
88.89% |
8 / 9 |
|
66.67% |
2 / 3 |
3.01 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| login | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |||
| logout | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Controller\Security; |
| 6 | |
| 7 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
| 8 | use Symfony\Component\HttpFoundation\Response; |
| 9 | use Symfony\Component\Routing\Attribute\Route; |
| 10 | use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; |
| 11 | |
| 12 | class 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 | } |