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