Config::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 2
crap 2
1
<?php
2
3
namespace Kaloa\Renderer;
4
5
use Kaloa\Renderer\SyntaxHighlighter;
6
use Kaloa\Renderer\SyntaxHighlighterInterface;
7
8
/**
9
 *
10
 * @api
11
 */
12
final class Config
13
{
14
    /**
15
     *
16
     * @var string
17
     */
18
    private $resourceBasePath;
19
20
    /**
21
     *
22
     * @var SyntaxHighlighterInterface
23
     */
24
    private $syntaxHighlighter;
25
26
    /**
27
     *
28
     * @param string $resourceBasePath
29
     * @param SyntaxHighlighterInterface $syntaxHighlighter
30
     */
31 48
    public function __construct(
32
        $resourceBasePath = '.',
33
        SyntaxHighlighterInterface $syntaxHighlighter = null
34
    ) {
35 48
        $this->resourceBasePath = (string) $resourceBasePath;
36
37 48
        $this->syntaxHighlighter = (null === $syntaxHighlighter)
38 48
                ? new SyntaxHighlighter()
39 48
                : $syntaxHighlighter;
40 48
    }
41
42
    /**
43
     *
44
     * @return string
45
     */
46 19
    public function getResourceBasePath()
47
    {
48 19
        return $this->resourceBasePath;
49
    }
50
51
    /**
52
     *
53
     * @return SyntaxHighlighterInterface
54
     */
55 19
    public function getSyntaxHighlighter()
56
    {
57 19
        return $this->syntaxHighlighter;
58
    }
59
}
60