RCFileCompiler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A compile() 0 8 2
1
<?php
2
3
namespace Acacha\Llum\Compiler;
4
5
class RCFileCompiler {
6
7
    /**
8
     * Compile the template using the given data.
9
     *
10
     * @param $template
11
     * @param $data
12
     * @return mixed
13
     */
14
    public function compile($template, $data)
15
    {
16
        foreach($data as $key => $value)
17
        {
18
            $template = preg_replace("/\\$$key\\$/i", $value, $template);
19
        }
20
        return $template;
21
    }
22
}