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

DefaultController::indexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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