Passed
Push — master ( d7eb06...71752e )
by Gabor
02:39
created

AddAction::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 7.1
6
 *
7
 * @copyright 2012 - 2018 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
declare(strict_types = 1);
13
14
namespace WebHemi\Middleware\Action\Admin\Applications;
15
16
/**
17
 * Class AddAction.
18
 */
19
class AddAction extends IndexAction
20
{
21
    /**
22
     * Gets template map name or template file path.
23
     *
24
     * @return string
25
     */
26
    public function getTemplateName() : string
27
    {
28
        return 'admin-applications-add';
29
    }
30
31
    /**
32
     * Gets template data.
33
     *
34
     * @return array
35
     */
36
    public function getTemplateData() : array
37
    {
38
        // TODO fix to get it from the request object
39
        $applicationUri = '/';
40
        $this->response = $this->response
41
            ->withStatus(302, 'Found')
42
            ->withHeader('Location', $applicationUri.'applications');
43
44
        return [];
45
    }
46
}
47