Completed
Push — dev ( fbc559...d52615 )
by Serhii
10s
created

DefaultController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A loginAction() 0 11 1
A indexAction() 0 4 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 1
    public function indexAction()
17
    {
18 1
        return [];
19
    }
20
21
    /**
22
     * @Route("/login", name="login")
23
     *
24
     * @return \Symfony\Component\HttpFoundation\Response
25
     * @Method({"GET", "POST"})
26
     */
27
    public function loginAction()
28
    {
29
        $authenticationUtils = $this->get('security.authentication_utils');
30
        $error = $authenticationUtils->getLastAuthenticationError();
31
        $lastUsername = $authenticationUtils->getLastUsername();
32
33
        return $this->render('@App/login.html.twig', array(
34
            'last_username' => $lastUsername, //$lastUsername,
35
            'error' => $error,
36
        ));
37
    }
38
39
    /**
40
     * @Route("/logout", name="logout")
41
     */
42
    public function logoutAction()
43
    {
44
    }
45
}
46