SecurityController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A loginAction() 0 19 1
A securedAction() 0 4 1
1
<?php
2
3
namespace AppBundle\Controller;
4
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Symfony\Component\HttpFoundation\Request;
8
use Symfony\Component\HttpFoundation\Response;
9
10
class SecurityController extends Controller
11
{
12
    /**
13
     * @Route("/login", name="login")
14
     */
15
    public function loginAction(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...
16
    {
17
        $authenticationUtils = $this->get('security.authentication_utils');
18
19
        // get the login error if there is one
20
        $error = $authenticationUtils->getLastAuthenticationError();
21
22
        // last username entered by the user
23
        $lastUsername = $authenticationUtils->getLastUsername();
24
25
        return $this->render(
26
            'security/login.html.twig',
27
            array(
28
                // last username entered by the user
29
                'last_username' => $lastUsername,
30
                'error'         => $error,
31
            )
32
        );
33
    }
34
35
    /**
36
     * @Route("/secured", name="secured")
37
     */
38
    public function securedAction(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
        return $this->render('security/secured.html.twig');
41
    }
42
}
43