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

PostListAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplateName() 0 4 1
B getTemplateData() 0 25 1
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