None   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 38
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A wait() 0 3 1
A isAvailable() 0 3 1
A start() 0 5 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2025
6
 * @package Base
7
 * @subpackage Process
8
 */
9
10
11
namespace Aimeos\Base\Process;
12
13
14
/**
15
 * No parallel processing implementation
16
 *
17
 * @package Base
18
 * @subpackage Process
19
 */
20
class None implements Iface
21
{
22
	/**
23
	 * Checks if processing tasks in parallel is available
24
	 *
25
	 * @return bool True if available, false if not
26
	 */
27
	public function isAvailable() : bool
28
	{
29
		return false;
30
	}
31
32
33
	/**
34
	 * Starts a new task by executing the given anonymous function
35
	 *
36
	 * @param \Closure $fcn Anonymous function to execute
37
	 * @param array $data List of parameters that is passed to the closure function
38
	 * @param bool $restart True if the task should be restarted if it fails (only once)
39
	 * @return \Aimeos\Base\Process\Iface Self object for method chaining
40
	 * @throws \Aimeos\Base\Process\Exception If starting the new task failed
41
	 */
42
	public function start( \Closure $fcn, array $data, bool $restart = false ) : Iface
43
	{
44
		call_user_func_array( $fcn, $data );
45
46
		return $this;
47
	}
48
49
50
	/**
51
	 * Waits for the running tasks until all have finished
52
	 *
53
	 * @return \Aimeos\Base\Process\Iface Self object for method chaining
54
	 */
55
	public function wait() : Iface
56
	{
57
		return $this;
58
	}
59
}
60