Passed
Push — master ( 380f9e...cfd1fb )
by Gabor
05:22
created

GetDatesHelper   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 71
ccs 0
cts 23
cp 0
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A getDefinition() 0 4 1
A getOptions() 0 4 1
A getDescription() 0 4 1
A __invoke() 0 9 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\Renderer\Helper;
15
16
use WebHemi\Environment\ServiceInterface as EnvironmentInterface;
17
use WebHemi\Renderer\HelperInterface;
18
19
/**
20
 * Class GetDatesHelper
21
 */
22
class GetDatesHelper implements HelperInterface
23
{
24
    /** @var EnvironmentInterface */
25
    private $environmentManager;
26
27
    /**
28
     * GetTagsHelper constructor.
29
     *
30
     * @param EnvironmentInterface $environmentManager
31
     */
32
    public function __construct(EnvironmentInterface $environmentManager)
33
    {
34
        $this->environmentManager = $environmentManager;
35
    }
36
37
    /**
38
     * Should return the name of the helper.
39
     *
40
     * @return string
41
     */
42
    public static function getName() : string
43
    {
44
        return 'getDates';
45
    }
46
47
    /**
48
     * Should return the name of the helper.
49
     *
50
     * @return string
51
     */
52
    public static function getDefinition() : string
53
    {
54
        return '{{ getDates(order_by, limit) }}';
55
    }
56
57
    /**
58
     * Gets helper options for the render.
59
     *
60
     * @return array
61
     * @codeCoverageIgnore - empty array
62
     */
63
    public static function getOptions() : array
64
    {
65
        return [];
66
    }
67
68
    /**
69
     * Should return a description text.
70
     *
71
     * @return string
72
     */
73
    public static function getDescription() : string
74
    {
75
        return 'Returns the archive dates for the current application.';
76
    }
77
78
    /**
79
     * A renderer helper should be called with its name.
80
     *
81
     * @return array
82
     */
83
    public function __invoke() : array
84
    {
85
        /* TODO: tbd */
86
87
        return [
88
            ['url' => '2017-05', 'title' => '2017 May',  'total' => 280, 'new' => 0],
89
            ['url' => '2017-06', 'title' => '2017 June', 'total' => 280, 'new' => 0],
90
        ];
91
    }
92
}
93