Passed
Push — master ( 0c9802...435388 )
by Rougin
04:16
created

BladeRenderer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A render() 0 3 1
1
<?php
2
3
namespace Zapheus\Bridge\Illuminate;
4
5
use Illuminate\Contracts\View\Factory;
6
use Zapheus\Renderer\RendererInterface;
7
8
/**
9
 * Illuminate View (Blade) Renderer
10
 *
11
 * @package Staticka
12
 * @author  Rougin Gutib <[email protected]>
13
 */
14
class BladeRenderer implements RendererInterface
15
{
16
    /**
17
     * @var \Illuminate\Contracts\View\Factory
18
     */
19
    protected $factory;
20
21
    /**
22
     * Initializes the renderer instance.
23
     *
24
     * @param \Illuminate\Contracts\View\Factory $factory
25
     */
26 2
    public function __construct(Factory $factory)
27
    {
28 2
        $this->factory = $factory;
29 2
    }
30
31
    /**
32
     * Renders a template.
33
     *
34
     * @param  string $template
35
     * @param  array  $data
36
     * @return string
37
     */
38 2
    public function render($template, array $data = array())
39
    {
40 2
        return $this->factory->make($template, $data)->render();
41
    }
42
}
43