Completed
Push — master ( cefe8d...0ca202 )
by Andrii
03:36
created

AbstractRenderer::getConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Changelog keeper
4
 *
5
 * @link      https://github.com/hiqdev/chkipper
6
 * @package   chkipper
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\chkipper\history;
12
13
/**
14
 * Abstract history renderer.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
abstract class AbstractRenderer
19
{
20
    /**
21
     * @var ConfigInterface config object
22
     */
23
    protected $_config;
24
25
    public $normalizeOptions = [];
26
27 2
    public function __construct(ConfigInterface $config)
28
    {
29 2
        $this->_config = $config;
30 2
    }
31
32 1
    public function getConfig()
33
    {
34 1
        return $this->_config;
35
    }
36
37 2
    public function setHistory($value)
38
    {
39 2
        $this->_history = $value;
0 ignored issues
show
Bug introduced by
The property _history does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
40 2
        $this->_history->normalize($this->normalizeOptions);
41 2
    }
42
43 2
    public function getHistory()
44
    {
45 2
        return $this->_history;
46
    }
47
48
    /**
49
     * Renders history to string.
50
     * @param History $history
51
     * @return string
52
     */
53
    abstract public function render(History $history);
54
}
55