Result   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 0
dl 0
loc 27
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A output() 0 8 2
1
<?php
2
3
namespace tomzx\Dataflow;
4
5
class Result {
6
	/**
7
	 * @var array
8
	 */
9
	private $nodes = [];
10
11
	/**
12
	 * @param array $nodes
13
	 */
14 7
	public function __construct(array $nodes)
15
	{
16 7
		$this->nodes = $nodes;
17 7
	}
18
19
	/**
20
	 * @param int|string $nodeIndex
21
	 * @return mixed|null
22
	 */
23 7
	public function output($nodeIndex)
24
	{
25 7
		if ( ! array_key_exists($nodeIndex, $this->nodes)) {
26 1
			return null;
27
		}
28
29 6
		return $this->nodes[$nodeIndex]->output();
30
	}
31
}
32