IndexController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
1
<?php
2
3
namespace App\Controller;
4
5
use App\Mercure\CookieGenerator;
6
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7
use Symfony\Component\HttpFoundation\Response;
8
use Symfony\Component\Routing\Annotation\Route;
9
10
final class IndexController extends AbstractController
11
{
12
    /**
13
     * @Route("/", name="home")
14
     */
15
    public function __invoke(CookieGenerator $cookieGenerator): Response
16
    {
17
        $response = $this->render('pages/index.html.twig', []);
18
        $response->headers->setCookie($cookieGenerator->generate());
19
20
        return $response;
21
    }
22
}
23