ThreadFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
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