Completed
Push — master ( c02fce...0001a8 )
by Johannes
03:23
created

AbstractAction::getEntryParser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace Jolicht\MarkdownCms\Action;
11
12
use Zend\Expressive\Template\TemplateRendererInterface;
13
use Psr\Http\Message\ServerRequestInterface;
14
use Psr\Http\Message\ResponseInterface;
15
use Jolicht\MarkdownCms\ContentType\EntryParser;
16
17
abstract class AbstractAction
18
{
19
    /**
20
     * Template renderer
21
     *
22
     * @var TemplateRendererInterface
23
     */
24
    private $templateRenderer;
25
26
    /**
27
     * Entry parser
28
     *
29
     * @var EntryParser
30
     */
31
    private $entryParser;
32
33
    /**
34
     * Markdown cms config
35
     *
36
     * @var array
37
     */
38
    private $markdownCmsConfig;
39
40
41
    public function __construct(TemplateRendererInterface $templateRenderer, EntryParser $entryParser,
42
        array $markdownCmsConfig)
43
    {
44
        $this->templateRenderer = $templateRenderer;
45
        $this->entryParser = $entryParser;
46
        $this->markdownCmsConfig = $markdownCmsConfig;
47
    }
48
49
    abstract public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null);
50
51
    /**
52
     * Get template renderer
53
     *
54
     * @return TemplateRendererInterface
55
     */
56
    public function getTemplateRenderer() : TemplateRendererInterface
57
    {
58
        return $this->templateRenderer;
59
    }
60
61
    /**
62
     * Get entry parser
63
     *
64
     * @return EntryParser
65
     */
66
    public function getEntryParser() : EntryParser
67
    {
68
        return $this->entryParser;
69
    }
70
71
    /**
72
     * Get markdown cms config
73
     *
74
     * @return array
75
     */
76
    public function getMarkdownCmsConfig() : array
77
    {
78
        return $this->markdownCmsConfig;
79
    }
80
}