Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | abstract class AbstractRenderer |
||
23 | { |
||
24 | /** |
||
25 | * @var ConfigInterface config object |
||
26 | */ |
||
27 | protected $_config; |
||
28 | |||
29 | protected $normalization = Normalization::class; |
||
30 | |||
31 | 2 | public function __construct(ConfigInterface $config) |
|
32 | { |
||
33 | 2 | $this->_config = $config; |
|
34 | 2 | } |
|
35 | |||
36 | 1 | public function getConfig() |
|
37 | { |
||
38 | 1 | return $this->_config; |
|
39 | } |
||
40 | |||
41 | 2 | public function setHistory(History $history) |
|
42 | { |
||
43 | 2 | if (!empty($this->normalization)) { |
|
44 | 2 | Normalization::create($this->normalization)->run($history); |
|
45 | 2 | } |
|
46 | 2 | $this->_history = $history; |
|
|
|||
47 | 2 | } |
|
48 | |||
49 | 2 | public function getHistory() |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * Renders history to string. |
||
56 | * @param History $history |
||
57 | * @return string |
||
58 | */ |
||
59 | abstract public function render(History $history); |
||
60 | } |
||
61 |