Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 |
||
58 | } |
||
59 | } |
||
60 |