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