Job::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 9.4286
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace tomzx\Dataflow\Processor\Parallel;
4
5
use tomzx\Dataflow\Node;
6
use tomzx\Dataflow\Processor\Parallel\Threaded;
7
8
class Job extends Threaded {
9
	/**
10
	 * @var \tomzx\Dataflow\Node
11
	 */
12
	private $node;
13
14
	/**
15
	 * @var array
16
	 */
17
	private $arguments;
18
19
	/**
20
	 * @param \tomzx\Dataflow\Node $node
21
	 * @param array                $arguments
22
	 */
23
	public function __construct(Node $node, array $arguments = [])
24
	{
25
		$this->node = $node;
26
		$this->arguments = $arguments;
27
	}
28
29
	/**
30
	 * @return void
31
	 */
32
	public function run()
33
	{
34
		// Must cast to array since it is a Volatile
35
		call_user_func_array([$this->node, 'process'], (array)$this->arguments);
36
	}
37
}
38