Test Failed
Push — main ( 5da9e4...74d919 )
by Michael
09:18
created

TestController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Braunstetter\MenuBundle\Test\app\src\Controller;
4
5
use Symfony\Component\HttpFoundation\Response;
6
use Twig\Environment;
7
use Twig\Error\LoaderError;
8
use Twig\Error\RuntimeError;
9
use Twig\Error\SyntaxError;
10
11
class TestController
12
{
13
14
    private Environment $twig;
15
16
    /**
17
     * @param Environment $twig
18
     */
19
    public function __construct(Environment $twig)
20
    {
21
22
        $this->twig = $twig;
23
    }
24
25
    /**
26
     * @throws SyntaxError
27
     * @throws RuntimeError
28
     * @throws LoaderError
29
     */
30
    public function index($name): Response
31
    {
32
        return (new Response())
33
            ->setContent($this->twig->render('test.html.twig', ['name' => $name]));
34
    }
35
36
    /**
37
     * @throws SyntaxError
38
     * @throws RuntimeError
39
     * @throws LoaderError
40
     */
41
    public function levelOneRoute(): Response
42
    {
43
        return (new Response())
44
            ->setContent($this->twig->render('test.html.twig'));
45
    }
46
47
    /**
48
     * @throws SyntaxError
49
     * @throws RuntimeError
50
     * @throws LoaderError
51
     */
52
    public function levelTwoRoute(): Response
53
    {
54
        return (new Response())
55
            ->setContent($this->twig->render('test.html.twig'));
56
    }
57
58
    /**
59
     * @throws RuntimeError
60
     * @throws SyntaxError
61
     * @throws LoaderError
62
     */
63
    public function levelThreeRoute(): Response
64
    {
65
        return (new Response())
66
            ->setContent($this->twig->render('test.html.twig'));
67
    }
68
69
70
}