Node   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A process() 0 6 1
A output() 0 4 1
1
<?php
2
3
namespace tomzx\Dataflow;
4
5
use tomzx\Dataflow\Processor\Parallel\Threaded;
6
7
class Node extends Threaded {
8
	/**
9
	 * @var callable
10
	 */
11
	private $callable;
12
13
	/**
14
	 * @var mixed
15
	 */
16
	private $result;
17
18
	/**
19
	 * @param callable $callable
20
	 */
21 9
	public function __construct(callable $callable)
22
	{
23 9
		$this->callable = $callable;
24 9
	}
25
26
	/**
27
	 * @return mixed
28
	 */
29 7
	public function process()
30
	{
31 7
		$this->result = call_user_func_array($this->callable, func_get_args());
32
33 7
		return $this->result;
34
	}
35
36
	/**
37
	 * @return mixed
38
	 */
39 6
	public function output()
40
	{
41 6
		return $this->result;
42
	}
43
}
44