Renderer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A __construct() 0 3 1
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