Conditions | 7 |
Paths | 12 |
Total Lines | 31 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 17 |
CRAP Score | 7.0084 |
Changes | 4 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
16 | 4 | public function run(Filesystem $fs) |
|
17 | { |
||
18 | 4 | $result = []; |
|
19 | 4 | $cache = $fs->getPath('.cache'); |
|
20 | 4 | if (is_dir($cache)) { |
|
21 | 4 | foreach ($fs->listFiles('.cache') as $file) { |
|
22 | unlink($fs->getPath('.cache/'.$file)); |
||
23 | } |
||
24 | 4 | rmdir($cache); |
|
25 | } |
||
26 | |||
27 | 4 | $procedures = $fs->listClasses('Procedure'); |
|
28 | 4 | if (count($procedures)) { |
|
29 | 4 | foreach ($procedures as $procedure) { |
|
30 | 4 | $this->get(Mapper::class)->getPlugin(Procedure::class)->register($procedure); |
|
31 | } |
||
32 | } |
||
33 | |||
34 | 4 | $this->get(Mapper::class)->getPlugin(Procedure::class) |
|
35 | 4 | ->register(IndexInArray::class); |
|
36 | |||
37 | 4 | foreach ($this->jobs as $job) { |
|
38 | try { |
||
39 | 4 | $result[$job] = $this->dispatch($job); |
|
40 | 4 | } catch (Exception $e) { |
|
41 | 4 | $result[$job] = $e->getMessage(); |
|
42 | } |
||
43 | } |
||
44 | |||
45 | 4 | return $result; |
|
46 | } |
||
47 | } |
||
48 |