LuckyController::number()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
ccs 0
cts 4
cp 0
crap 2
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