Conditions | 5 |
Paths | 9 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function run(Runner $runner, Service $service, Filesystem $fs, Converter $converter) |
||
16 | { |
||
17 | $runner->dispatch('tarantool.migrate'); |
||
18 | |||
19 | $meta = $runner->dispatch('module.meta'); |
||
20 | foreach ($meta['jobs'] as $job) { |
||
21 | $class = new ReflectionClass($runner->getJobClass($job)); |
||
22 | $params = []; |
||
23 | foreach ($class->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { |
||
24 | $params[] = $property->getName(); |
||
25 | } |
||
26 | $service->registerJob($job, $params); |
||
27 | } |
||
28 | |||
29 | foreach ($fs->listClasses('Listeners') as $class) { |
||
30 | $chain = str_replace('\\', '.', substr($class, 10)); |
||
31 | |||
32 | foreach ($chain as $k => $v) { |
||
|
|||
33 | $chain[$k] = $converter->toCamelCase($v); |
||
34 | } |
||
35 | $event = implode('.', $event); |
||
36 | |||
37 | $service->subscribe($event); |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 |