Completed
Push — master ( bd60ab...c7f462 )
by T
02:13
created

Result   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 24
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 6
	public function __construct(array $nodes)
12
	{
13 6
		$this->nodes = $nodes;
14 6
	}
15
16
	/**
17
	 * @param int|string $nodeIndex
18
	 * @return null
19
	 */
20 6
	public function output($nodeIndex)
21
	{
22 6
		if ( ! array_key_exists($nodeIndex, $this->nodes)) {
23 1
			return null;
24
		}
25
26 5
		return $this->nodes[$nodeIndex]->output();
27
	}
28
}
29