Completed
Pull Request — master (#30)
by nonanerz
04:41
created

DefaultController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

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