Completed
Push — SF4 ( 4a7883...4059c5 )
by Laurent
07:51
created

SecurityController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A login() 0 13 1
1
<?php
2
3
/**
4
 * SecurityController Controller d'authentification.
5
 *
6
 * PHP Version 7
7
 *
8
 * @author    Quétier Laurent <[email protected]>
9
 * @copyright 2018 Dev-Int GLSR
10
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
11
 *
12
 * @version GIT: $Id$
13
 *
14
 * @link https://github.com/Dev-Int/glsr
15
 */
16
17
namespace App\Controller;
18
19
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
20
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
21
use Symfony\Component\HttpFoundation\Request;
22
use Symfony\Component\Routing\Annotation\Route;
23
24
/**
25
 * Controller of Security
26
 *
27
 * @category Controller
28
 */
29
class SecurityController extends Controller
30
{
31
    /**
32
     * @Route("/login", name="login")
33
     */
34
    public function login(Request $request, AuthenticationUtils $authenticationUtils)
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...
35
    {
36
        // get the login error if there is one
37
        $error = $authenticationUtils->getLastAuthenticationError();
38
39
        // last username entered by the user
40
        $lastUsername = $authenticationUtils->getLastUsername();
41
42
        return $this->render('security/login.html.twig', [
43
            'last_username' => $lastUsername,
44
            'error'         => $error,
45
        ]);
46
    }
47
}
48