ThreadFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
1
<?php
2
3
namespace Wonderland\Thread\Factory;
4
5
use Wonderland\Thread\Thread;
6
7
class ThreadFactory
8
{
9
10
	/**
11
	 * @param $processName
12
	 * @param callable $function
13
	 * @return Thread
14
	 */
15 1
	public static function create(string $processName, callable $function): Thread
16
	{
17 1
		$thread = new Thread();
18 1
		$thread->setCallback($function);
19 1
		$thread->setProcessName($processName);
20
21 1
		return $thread;
22
	}
23
24
}
25