Passed
Push — master ( 749b16...167cfa )
by Gabor
04:47
created

PostListAction::getTemplateData()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 7.1
6
 *
7
 * @copyright 2012 - 2017 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\Website;
15
16
use WebHemi\Middleware\AbstractMiddlewareAction;
17
18
/**
19
 * Class PostListAction
20
 */
21
class PostListAction extends AbstractMiddlewareAction
22
{
23
    /**
24
     * Gets template map name or template file path.
25
     *
26
     * @return string
27
     */
28
    public function getTemplateName() : string
29
    {
30
        return 'website-post-list';
31
    }
32
33
    /**
34
     * Gets template data.
35
     *
36
     * @return array
37
     */
38
    public function getTemplateData() : array
39
    {
40
        return [
41
            'blogPosts' => [
42
                [
43
                    'title'       => 'Fake test 1',
44
                    'slug'        => 'fake_1',
45
                    'publishedAt' => time(),
46
                    'author'      => [
47
                        'name' => 'Amadeus'
48
                    ],
49
                    'content'     => 'Lorem ipsum dolor sit amet...'
50
                ],
51
                [
52
                    'title'       => 'Fake test 2',
53
                    'slug'        => 'fake_2',
54
                    'publishedAt' => time(),
55
                    'author'      => [
56
                        'name' => 'Jane Doe'
57
                    ],
58
                    'content'     => 'Lorem ipsum dolor sit amet...'
59
                ]
60
            ],
61
        ];
62
    }
63
}
64