Passed
Push — master ( 53136f...ce1219 )
by Thomas
16:59 queued 07:11
created

SymfonyTestController::indexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 11
rs 9.4285
1
<?php
2
3
namespace AppBundle\Controller;
4
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6
use Symfony\Component\HttpFoundation\Request;
7
8
class SymfonyTestController extends AbstractController
9
{
10
    /**
11
     * @Route("/symfony-test/", name="symfony-test")
12
     *
13
     *
14
     * @param \Symfony\Component\HttpFoundation\Request $request
15
     *
16
     * @return \Symfony\Component\HttpFoundation\Response
17
     */
18
    public function indexAction(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        $user = $this->getUser();
21
22
        $this->setMenu(MNU_CACHES_SEARCH);
23
        $this->setTitle('Symfony Controlled');
24
25
        return $this->render('default/index.html.twig', [
26
            'user' => $user
27
        ]);
28
    }
29
30
    /**
31
     * @Route("/symfony-test/forced-login/", name="symfony-test.forced-login")
32
     *
33
     *
34
     * @param \Symfony\Component\HttpFoundation\Request $request
35
     *
36
     * @return \Symfony\Component\HttpFoundation\Response
37
     */
38
    public function forcedLoginAction(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
    {
40
        $this->denyAccessUnlessGranted('ROLE_USER', null, 'Unable to access this page!');
41
42
        $user = $this->getUser();
43
        dump($user->getRoles());
44
45
        $this->setMenu(MNU_CACHES_SEARCH);
46
        $this->setTitle('Symfony Controlled');
47
48
        return $this->render('default/index.html.twig', [
49
            'user' => $user
50
        ]);
51
    }
52
}
53