Renderer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Staticka;
4
5
use Staticka\Contracts\RendererContract;
6
// TODO: To be removed in v1.0.0.
7
// Implement own renderer instead.
8
use Zapheus\Renderer\Renderer as ZapheusRenderer;
9
10
/**
11
 * Renderer
12
 *
13
 * @package Staticka
14
 * @author  Rougin Gutib <[email protected]>
15
 */
16
class Renderer implements RendererContract
17
{
18
    /**
19
     * @var \Zapheus\Renderer\RendererInterface
20
     */
21
    protected $zapheus;
22
23
    /**
24
     * @param string[] $paths
25
     */
26 27
    public function __construct($paths)
27
    {
28 27
        $this->zapheus = new ZapheusRenderer($paths);
29 27
    }
30
31
    /**
32
     * Renders a file from a specified template.
33
     *
34
     * @param  string $name
35
     * @param  array  $data
36
     * @return string
37
     *
38
     * @throws \InvalidArgumentException
39
     */
40 6
    public function render($name, $data = array())
41
    {
42 6
        return $this->zapheus->render($name, $data);
43
    }
44
}
45