Passed
Push — master ( 431198...0d9638 )
by
unknown
01:44
created

Php::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
ccs 10
cts 10
cp 1
cc 1
eloc 9
nc 1
nop 2
crap 1
1
<?php
2
3
namespace CarbonFramework\Templating;
4
5
/**
6
 * Include template files with php
7
 */
8
class Php implements EngineInterface {
9
	/**
10
	 * {@inheritDoc}
11
	 */
12 2
	public function render( $file, $context ) {
13 2
		$__template = $file;
14 2
		$__context = $context;
15 2
		$renderer = function() use ( $__template, $__context ) {
16 2
			ob_start();
17 2
			extract( $__context );
18 2
			include( $__template );
19 2
			return ob_get_clean();
20 2
		};
21 2
		return $renderer();
22
	}
23
}
24