Json   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 15
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 6 1
1
<?php
2
/**
3
 * The class is responsible for rendering JSON templates
4
 *
5
 * PHP version 5.5
6
 *
7
 * @category   OpCacheGUI
8
 * @package    Presentation
9
 * @author     Pieter Hordijk <[email protected]>
10
 * @copyright  Copyright (c) 2014 Pieter Hordijk <https://github.com/PeeHaa>
11
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
12
 * @version    1.0.0
13
 */
14
namespace OpCacheGUI\Presentation;
15
16
/**
17
 * The class is responsible for rendering JSON templates
18
 *
19
 * @category   OpCacheGUI
20
 * @package    Presentation
21
 * @author     Pieter Hordijk <[email protected]>
22
 */
23
class Json extends Template
24
{
25
    /**
26
     * Renders a template
27
     *
28
     * @param string $template The template to render
29
     * @param array  $data     The data to use in the template
30
     */
31 1
    public function render($template, array $data = [])
32
    {
33 1
        $this->variables = $data;
34
35 1
        return require $this->templateDirectory . '/' . $template;
36
    }
37
}
38