Completed
Branch Gutenberg/form-system (1dc3a2)
by
unknown
88:07 queued 79:28
created

BlockRenderer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setTemplateRootPath() 0 4 1
A templateRootPath() 0 4 1
1
<?php
2
namespace EventEspresso\core\services\blocks;
3
4
use EventEspresso\core\domain\DomainInterface;
5
6
/**
7
 * BlockRenderer
8
 *
9
 *
10
 * @package EventEspresso\core\services\blocks
11
 * @author  Darren Ethier
12
 * @since   $VID:$
13
 */
14
abstract class BlockRenderer implements BlockRendererInterface
15
{
16
17
    /**
18
     * @var DomainInterface
19
     */
20
    protected $domain;
21
22
    /**
23
     * @var string
24
     */
25
    private $template_root_path;
26
27
28
    /**
29
     * BlockRenderer constructor.
30
     *
31
     * @param DomainInterface $domain
32
     */
33
    public function __construct(DomainInterface $domain)
34
    {
35
        $this->domain = $domain;
36
        $this->setTemplateRootPath();
37
    }
38
39
40
    /**
41
     * Sets the root path to the main block template.
42
     */
43
    private function setTemplateRootPath()
44
    {
45
        $this->template_root_path = $this->domain->pluginPath() . 'ui/blocks/';
46
    }
47
48
49
    /**
50
     * Exposes the root path for the main block template.
51
     * @return string
52
     */
53
    public function templateRootPath()
54
    {
55
        return $this->template_root_path;
56
    }
57
}
58