PatronEngine   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 12 1
1
<?php
2
3
/*
4
 * This file is part of the Patron package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Patron\RenderSupport;
13
14
use ICanBoogie\Render\Engine;
15
16
/**
17
 * Bridge to the _Patron_ engine.
18
 *
19
 * @package Patron\RenderSupport
20
 */
21
class PatronEngine implements Engine
22
{
23
	/**
24
	 * @inheritdoc
25
	 */
26
	public function render($template_pathname, $thisArg, array $variables, array $options = [])
27
	{
28
		$template = file_get_contents($template_pathname);
29
		$patron = \Patron\get_patron();
30
31
		return $patron($template, $thisArg, [
32
33
			'file' => $template_pathname,
34
			'variables' => [ self::VAR_TEMPLATE_PATHNAME => $template_pathname ] + $variables
35
36
		]);
37
	}
38
}
39