ci: add php cs fixer

This commit is contained in:
Maël Gangloff
2024-08-02 23:24:52 +02:00
parent cd5060ed6a
commit b460e8aaa6
41 changed files with 1413 additions and 440 deletions

View File

@@ -12,29 +12,30 @@ use Symfony\Component\Routing\RouterInterface;
class HomeController extends AbstractController
{
public function __construct(private readonly RouterInterface $router)
{
}
#[Route(path: "/", name: "index")]
#[Route(path: '/', name: 'index')]
public function index(): Response
{
return $this->render('base.html.twig');
}
#[Route(path: "/login/oauth", name: "oauth_connect")]
#[Route(path: '/login/oauth', name: 'oauth_connect')]
public function connectAction(ClientRegistry $clientRegistry): Response
{
return $clientRegistry->getClient('oauth')->redirect();
}
#[Route(path: "/logout", name: "logout")]
#[Route(path: '/logout', name: 'logout')]
public function logout(Security $security): ?RedirectResponse
{
$response = new RedirectResponse($this->router->generate('index'));
$response->headers->clearCookie('BEARER');
if ($security->isGranted('IS_AUTHENTICATED')) $security->logout(false);
if ($security->isGranted('IS_AUTHENTICATED')) {
$security->logout(false);
}
return $response;
}