Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
SequentialExample | |
0.00% |
0 / 16 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
retrieveDeclaration | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
6 | |||
getCurrentVersion | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getMaxRetries | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | namespace Apie\Fixtures\BackgroundProcess; |
3 | |
4 | use Apie\Core\BackgroundProcess\BackgroundProcessDeclaration; |
5 | |
6 | class SequentialExample implements BackgroundProcessDeclaration |
7 | { |
8 | public static function retrieveDeclaration(int $version): array |
9 | { |
10 | if ($version === 1) { |
11 | return [ |
12 | function (int $payload) { |
13 | return $payload / $payload; |
14 | } |
15 | ]; |
16 | } |
17 | |
18 | return [ |
19 | function (int $payload) { |
20 | return 42; |
21 | }, |
22 | function (int $payload) { |
23 | return $payload / $payload; |
24 | } |
25 | ]; |
26 | } |
27 | |
28 | public function getCurrentVersion(): int |
29 | { |
30 | return 2; |
31 | } |
32 | |
33 | public static function getMaxRetries(int $version): int |
34 | { |
35 | return $version; |
36 | } |
37 | } |