ExpressionNode   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 30
rs 10
wmc 4
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __invoke() 0 11 2
A render() 0 4 1
1
<?php
2
3
namespace Patron;
4
5
class ExpressionNode extends Node
6
{
7
	const REGEX = '~\#\{(?!\s)([^\}]+)\}~';
8
9
	protected $expression;
10
	protected $escape;
11
12
	public function __construct($expression, $escape)
13
	{
14
		$this->expression = $expression;
15
		$this->escape = $escape;
16
	}
17
18
	public function __invoke(Engine $engine, $context)
19
	{
20
		$rc = $this->render($this->expression);
21
22
		if ($this->escape)
23
		{
24
			$rc = \ICanBoogie\escape($rc);
25
		}
26
27
		return $rc;
28
	}
29
30
	protected function render($expression)
31
	{
32
		return $expression;
33
	}
34
}
35