IndexController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 24
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A indexAction() 0 12 1
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