Completed
Push — master ( d310cf...1228ca )
by Rougin
02:55
created

BladeRenderer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A render() 0 4 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 Royce 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
    public function __construct(Factory $factory)
27
    {
28
        $this->factory = $factory;
29
    }
30
31
    /**
32
     * Renders a template.
33
     *
34
     * @param  string $template
35
     * @param  array  $data
36
     * @return string
37
     */
38
    public function render($template, array $data = array())
39
    {
40
        return $this->factory->make($template, $data)->render();
41
    }
42
}
43