RCFileCompiler::compile()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 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
}