Template   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A getIterator() 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
class Template implements \IteratorAggregate
15
{
16
	/**
17
	 * @var string|null
18
	 */
19
	public $file;
20
21
	/**
22
	 * @var Node[]
23
	 */
24
	public $nodes;
25
26
	/**
27
	 * @param Node[] $nodes
28
	 * @param array $options
29
	 */
30
	public function __construct(array $nodes, array $options = [])
31
	{
32
		$this->nodes = $nodes;
33
34
		if (isset($options['file']))
35
		{
36
			$this->file = $options['file'];
37
		}
38
	}
39
40
	/**
41
	 * @return Node[]|\ArrayIterator
42
	 */
43
	public function getIterator()
44
	{
45
		return new \ArrayIterator($this->nodes);
46
	}
47
}
48