IndexController::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace AppBundle\Controller;
5
6
use \PommProject\Foundation\Pomm;
7
use \Symfony\Component\HttpFoundation\Response;
8
use \Symfony\Component\Templating\EngineInterface;
9
10
final class IndexController
11
{
12
    private $pomm;
13
    private $templating;
14
15
    public function __construct(EngineInterface $templating, Pomm $pomm)
16
    {
17
        $this->templating = $templating;
18
        $this->pomm = $pomm;
19
    }
20
21
    public function indexAction(): Response
22
    {
23
        $result = $this->pomm['default']->getQueryManager()
24
            ->query('select 1');
25
26
        return new Response(
27
            $this->templating->render(
28
                'AppBundle:Index:index.html.twig',
29
                compact('result')
30
            )
31
        );
32
    }
33
}
34