HomeAction   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 2
b 0
f 0
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Controller;
6
7
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8
use Symfony\Component\HttpFoundation\Response;
9
// use Symfony\Component\HttpKernel\Attribute\AsController;
10
use Symfony\Component\HttpKernel\Attribute\Cache;
11
use Symfony\Component\Routing\Attribute\Route;
12
13
/**
14
 * @see StaticRoutesSmokeTest
15
 */
16
// using the AsController attribute is not mandatory when extending the Symfony AbstractController or when using the #Route attribute.
17
// #[AsController]
18
#[Cache(maxage: 3600, public: true)]
19
final class HomeAction extends AbstractController
20
{
21
    /**
22
     * Simple page with some content.
23
     */
24 2
    #[Route(path: '/', name: self::class)]
25
    public function __invoke(): Response
26
    {
27 2
        $readme = (string) file_get_contents(__DIR__.'/../../README.md');
28
29 2
        return $this->render(self::class.'.html.twig', ['readme' => $readme]);
30
    }
31
}
32