TestController::showTestAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 13
ccs 0
cts 10
cp 0
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
crap 2
1
<?php
2
3
namespace AppBundle\Controller\Test;
4
5
use AppBundle\Entity\ModuleUser;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
9
10
11
/**
12
 * Class TestController
13
 * @package AppBundle\Controller\Test
14
 */
15
class TestController extends Controller
16
{
17
    /**
18
     * @Route("/test", name="show_test")
19
     * @Template("@App/test/test.html.twig")
20
     */
21
    public function showTestAction()
22
    {
23
        $user = $this->getUser();
24
25
        $em = $this->getDoctrine()->getManager();
26
27
        $modules = $em->getRepository('AppBundle:ModuleUser')
28
            ->findModuleUserActive($user);
29
30
        return [
31
            'modules' => $modules
32
        ];
33
    }
34
}
35