Conditions | 7 |
Paths | 16 |
Total Lines | 34 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public static function execute($watchmakerList, $cronList/*, $skipUnManage = false*/): array |
||
13 | { |
||
14 | $newList = []; |
||
15 | |||
16 | // check cron only |
||
17 | foreach ($cronList as $cron) |
||
18 | { |
||
19 | $cronLine = $cron->generate(); |
||
20 | foreach ($watchmakerList as $watchmaker) |
||
21 | { |
||
22 | if ($cronLine === $watchmaker->generate()) { |
||
23 | continue 2; |
||
24 | } |
||
25 | } |
||
26 | |||
27 | $newList[] = $cron->cronOnly(); |
||
28 | } |
||
29 | |||
30 | // check install or not install |
||
31 | foreach ($watchmakerList as $watchmaker) |
||
32 | { |
||
33 | $watchmakerLine = $watchmaker->generate(); |
||
34 | foreach ($cronList as $cron) |
||
35 | { |
||
36 | if ($watchmakerLine === $cron->generate()) { |
||
37 | $newList[] = $watchmaker->installed(); |
||
38 | continue 2; |
||
39 | } |
||
40 | } |
||
41 | |||
42 | $newList[] = $watchmaker->notInstalled(); |
||
43 | } |
||
44 | |||
45 | return $newList; |
||
46 | } |
||
48 |