Completed
Pull Request — dev (#22)
by
unknown
03:40
created

DefaultController::usersAddAction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 18
ccs 0
cts 0
cp 0
rs 9.4285
cc 2
eloc 13
nc 2
nop 1
crap 6
1
<?php
2
3
namespace AppBundle\Controller;
4
5
use AppBundle\Entity\User;
6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
9
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10
use Symfony\Component\HttpFoundation\RedirectResponse;
11
use Symfony\Component\HttpFoundation\Request;
12
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
13
14
class DefaultController extends Controller
15
{
16
    /**
17
     * @Route("/", name="homepage")
18
     * @Template("@App/dashboard.html.twig")
19
     */
20
    public function indexAction()
21
    {
22
        return [];
23
    }
24
25
    /**
26
     * @Route("/login", name="login")
27
     *
28
     * @return \Symfony\Component\HttpFoundation\Response
29
     * @Method({"GET", "POST"})
30
     */
31 4
    public function loginAction()
32
    {
33 4
        $authenticationUtils = $this->get('security.authentication_utils');
34 4
        $error = $authenticationUtils->getLastAuthenticationError();
35 4
        $lastUsername = $authenticationUtils->getLastUsername();
36
37 4
        return $this->render('@App/login.html.twig', array(
38 4
            'last_username' => $lastUsername, //$lastUsername,
39 4
            'error' => $error,
40
        ));
41
    }
42
}
43