Passed
Push — master ( c12552...22ad80 )
by Gabor
04:56
created

CategoryAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplateName() 4 4 1
A getTemplateData() 14 14 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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\Directory;
15
16
use WebHemi\Data\StorageInterface;
17
use WebHemi\Data\Storage;
18
use WebHemi\Data\Entity;
19
use WebHemi\DateTime;
20
use WebHemi\Environment\ServiceInterface as EnvironmentInterface;
21
use WebHemi\Middleware\Action\AbstractMiddlewareAction;
22
use WebHemi\Router\ProxyInterface;
23
use WebHemi\StorageTrait;
24
25
/**
26
 * Class CategoryAction.
27
 */
28 View Code Duplication
class CategoryAction extends AbstractMiddlewareAction
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
{
30
    /**
31
     * Gets template map name or template file path.
32
     *
33
     * @return string
34
     */
35
    public function getTemplateName() : string
36
    {
37
        return 'website-post-list';
38
    }
39
40
    /**
41
     * Gets template data.
42
     *
43
     * @return array
44
     */
45
    public function getTemplateData() : array
46
    {
47
        $blogPosts = [];
48
        $title = '';
49
        $parameters = $this->getRoutingParameters();
50
51
52
53
        return [
54
            'title' => $title,
55
            'activeMenu' => $parameters['uri_parameter'],
56
            'blogPosts' => $blogPosts,
57
        ];
58
    }
59
}
60