PatronEngine::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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