Passed
Branch main (02626f)
by Vedrana
05:25
created

LuckyControllerTwig   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 105
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

9 Methods

Rating   Name   Duplication   Size   Complexity  
A about() 0 4 1
A landningpage() 0 4 1
A bookpage() 0 4 1
A card() 0 4 1
A number() 0 10 1
A home() 0 4 1
A metrics() 0 4 1
A report() 0 4 1
A api() 0 4 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
9
/**
10
 * Controller for rendering pages using Twig templates.
11
 */
12
class LuckyControllerTwig extends AbstractController
13
{
14
    /**
15
     * Route that displays a random number.
16
     *
17
     * @return Response
18
     */
19
    #[Route("/lucky/twig", name: "lucky")]
20
    public function number(): Response
21
    {
22
        $number = random_int(0, 100);
23
24
        $data = [
25
            'number' => $number
26
        ];
27
28
        return $this->render('lucky.html.twig', $data);
29
    }
30
31
    /**
32
     * Route for the home page.
33
     *
34
     * @return Response
35
     */
36
    #[Route("/", name: "home")]
37
    public function home(): Response
38
    {
39
        return $this->render('home.html.twig');
40
    }
41
42
    /**
43
     * Route for the about page.
44
     *
45
     * @return Response
46
     */
47
    #[Route("/about", name: "about")]
48
    public function about(): Response
49
    {
50
        return $this->render('about.html.twig');
51
    }
52
53
    /**
54
     * Route for the project report page.
55
     *
56
     * @return Response
57
     */
58
    #[Route("/report", name: "report")]
59
    public function report(): Response
60
    {
61
        return $this->render('report.html.twig');
62
    }
63
64
    /**
65
     * Route for the API.
66
     *
67
     * @return Response
68
     */
69
    #[Route("/api", name: "api")]
70
    public function api(): Response
71
    {
72
        return $this->render('api.html.twig');
73
    }
74
75
    /**
76
     * Route for the card game landing page.
77
     *
78
     * @return Response
79
     */
80
    #[Route("/card", name: "card")]
81
    public function card(): Response
82
    {
83
        return $this->render('card/home.html.twig');
84
    }
85
86
    /**
87
     * Route for the game 21 landing page.
88
     *
89
     * @return Response
90
     */
91
    #[Route("/game", name: "game")]
92
    public function landningpage(): Response
93
    {
94
        return $this->render('game/home.html.twig');
95
    }
96
97
    /**
98
     * Route for the library.
99
     *
100
     * @return Response
101
     */
102
    #[Route("/library", name: "library")]
103
    public function bookpage(): Response
104
    {
105
        return $this->render('library/index.html.twig');
106
    }
107
108
    /**
109
     * Route for displaying metrics.
110
     *
111
     * @return Response
112
     */
113
    #[Route("/metrics", name: "metrics")]
114
    public function metrics(): Response
115
    {
116
        return $this->render('metrics.html.twig');
117
    }
118
119
}
120