ProjectController   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 26
ccs 0
cts 9
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A about() 0 4 1
A index() 0 4 1
A aboutDatabase() 0 4 1
A jsonApi() 0 6 1
1
<?php
2
3
namespace App\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\Routing\Annotation\Route;
8
use App\Entity\Game\Location;
9
use App\Repository\Game\LocationRepository;
10
11
class ProjectController extends AbstractController
12
{
13
    #[Route('/proj', name: 'proj')]
14
    public function index(): Response
15
    {
16
        return $this->render('proj/index.html.twig');
17
    }
18
19
    #[Route('/proj/about', name: 'proj_about')]
20
    public function about(): Response
21
    {
22
        return $this->render('proj/about.html.twig');
23
    }
24
25
    #[Route('/proj/about/database', name: 'proj_about_database')]
26
    public function aboutDatabase(): Response
27
    {
28
        return $this->render('proj/database.html.twig');
29
    }
30
31
    #[Route('/proj/api', name: 'proj_api')]
32
    public function jsonApi(LocationRepository $locationRepository): Response
33
    {
34
        $locations = $locationRepository->findAll();
35
36
        return $this->render('proj/api.html.twig', ['locations' => $locations]);
37
    }
38
}
39