AuthController::loginAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
namespace AppBundle\Controller;
3
4
use AppBundle\Form\Type\LoginFormType;
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
7
class AuthController extends Controller
8
{
9
    public function loginAction()
10
    {
11
        $authenticationUtils = $this->get('security.authentication_utils');
12
13
        $form = $this->createForm(LoginFormType::class, [
14
            'username' => $authenticationUtils->getLastUsername(),
15
        ], []);
16
17
        return $this->render('auth/login.html.twig', [
18
            'form' => $form->createView(),
19
            'error' => $authenticationUtils->getLastAuthenticationError(),
20
        ]);
21
    }
22
}
23