Controller   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 31
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 6 1
A robotstxt() 0 8 1
1
<?php
2
3
namespace BrainExe\Core\Index;
4
5
use BrainExe\Core\Annotations\Controller as ControllerAnnotation;
6
use BrainExe\Core\Annotations\Guest;
7
use BrainExe\Core\Annotations\Route;
8
use Symfony\Component\HttpFoundation\Response;
9
10
/**
11
 * @ControllerAnnotation
12
 */
13
class Controller
14
{
15
16
    /**
17
     * Deliver base HTML layout
18
     *
19
     * @return Response
20
     * @Route("/", name="index", methods="GET")
21
     * @Guest
22
     */
23 1
    public function index() : Response
24
    {
25 1
        $response = file_get_contents(ROOT . '/web/index.html');
26
27 1
        return new Response($response);
28
    }
29
30
    /**
31
     * @return Response
32
     * @Route("/robots.txt", name="robots.txt")
33
     * @Guest
34
     */
35 1
    public function robotstxt() : Response
36
    {
37 1
        $response = new Response();
38 1
        $response->headers->set('Content-Type', 'text/plain');
39 1
        $response->setContent("User-agent: *\nDisallow: /");
40
41 1
        return $response;
42
    }
43
}
44