Passed
Push — master ( 4b954d...b01812 )
by Gabor
03:38
created

DashboardAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTemplateName() 0 4 1
A getTemplateData() 0 7 1
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 5.6
6
 *
7
 * @copyright 2012 - 2016 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
13
namespace WebHemi\Middleware\Action\Admin;
14
15
use WebHemi\Adapter\Auth\AuthAdapterInterface;
16
use WebHemi\Middleware\AbstractMiddlewareAction;
17
18
/**
19
 * Class DashboardAction
20
 */
21
class DashboardAction extends AbstractMiddlewareAction
22
{
23
    /** @var AuthAdapterInterface */
24
    private $authAdapter;
25
26
    /**
27
     * DashboardAction constructor.
28
     *
29
     * @param AuthAdapterInterface $authAdapter
30
     */
31
    public function __construct(AuthAdapterInterface $authAdapter)
32
    {
33
        $this->authAdapter = $authAdapter;
34
    }
35
36
    /**
37
     * Gets template map name or template file path.
38
     *
39
     * @return string
40
     */
41
    public function getTemplateName()
42
    {
43
        return 'admin-dashboard';
44
    }
45
46
    /**
47
     * Gets template data.
48
     *
49
     * @return array
50
     */
51
    public function getTemplateData()
52
    {
53
        // @TODO TBD
54
        return [
55
            'user' => $this->authAdapter->getIdentity()
56
        ];
57
    }
58
}
59