BaseRenderer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getClassName() 0 4 1
A getName() 0 4 1
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL, Commercial` license[s].
5
 *
6
 * @package maslosoft/zamm
7
 * @license AGPL, Commercial
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link https://maslosoft.com/zamm/
11
 */
12
13
namespace Maslosoft\Zamm\Renderers;
14
15
use Maslosoft\Zamm\Interfaces\Extractors\ExtractorInterface;
16
use Maslosoft\Zamm\Interfaces\Renderers\RendererInterface;
17
18
/**
19
 * BaseRenderer
20
 *
21
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
22
 */
23
abstract class BaseRenderer implements RendererInterface
24
{
25
26
	/**
27
	 * Extractor
28
	 * @var ExtractorInterface
29
	 */
30
	protected $extractor;
31
32
	/**
33
	 * Extracted element name
34
	 * @var string
35
	 */
36
	protected $name = '';
37
38
	public function __construct(ExtractorInterface $extractor, $name = null)
39
	{
40
		$this->extractor = $extractor;
41
		$this->name = $name;
42
	}
43
44
	public function getClassName()
45
	{
46
		return $this->extractor->getClassName();
47
	}
48
49
	public function getName()
50
	{
51
		return $this->name;
52
	}
53
54
}
55