LoginController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 21
ccs 0
cts 10
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A loginAction() 0 13 1
1
<?php
2
3
namespace AppBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
8
9
/**
10
 * Class LoginController
11
 * @package AppBundle\Controller
12
 */
13
class LoginController extends Controller
14
{
15
    /**
16
     * @Route("/login", name="login_route")
17
     * @Template("@App/login/login.html.twig")
18
     *
19
     */
20
    public function loginAction()
21
    {
22
        $authenticationUtils = $this->get('security.authentication_utils');
23
24
        $error = $authenticationUtils->getLastAuthenticationError();
25
26
        $lastUsername = $authenticationUtils->getLastUsername();
27
28
        return [
29
                'last_username' => $lastUsername,
30
                'error'         => $error,
31
            ];
32
    }
33
}
34