EvaluateNode   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 5
Bugs 0 Features 0
Metric Value
c 5
b 0
f 0
dl 0
loc 31
rs 10
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
A render() 0 4 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;
13
14
/**
15
 * An evaluation node.
16
 *
17
 * The node is evaluated with the engine's `evaluate()` method.
18
 */
19
class EvaluateNode extends ExpressionNode
20
{
21
	/**
22
	 * @var Engine
23
	 */
24
	private $engine;
25
26
	/**
27
	 * @var array
28
	 */
29
	private $engine_context;
30
31
	/**
32
	 * @inheritdoc
33
	 */
34
	public function __invoke(Engine $engine, $context)
35
	{
36
		$this->engine = $engine;
37
		$this->engine_context = $context;
38
39
		return parent::__invoke($engine, $context);
40
	}
41
42
	/**
43
	 * @inheritdoc
44
	 */
45
	protected function render($expression)
46
	{
47
		return $this->engine->evaluate($expression, false, $this->engine_context);
48
	}
49
}
50