LuckyController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 17
rs 10
ccs 0
cts 8
cp 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hiResponse() 0 5 1
A number() 0 7 1
1
<?php
2
3
namespace App\Controller;
4
5
use Symfony\Component\HttpFoundation\JsonResponse;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\Routing\Annotation\Route;
8
9
class LuckyController
10
{
11
    #[Route('/lucky/number')]
12
    public function number(): Response
13
    {
14
        $number = random_int(0, 100);
15
16
        return new Response(
17
            '<html><body>Lucky number MEGA: '.$number.'</body></html>'
18
        );
19
    }
20
21
    #[Route("/lucky/hi")]
22
    public function hiResponse(): Response
23
    {
24
        return new Response(
25
            '<html><body>Hi to MEGA you!</body></html>'
26
        );
27
    }
28
}
29