Conditions | 5 |
Paths | 7 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
13 | public function run(Runner $runner) |
||
14 | { |
||
15 | $jobs = $runner->listJobs(); |
||
16 | |||
17 | $info = []; |
||
18 | foreach($jobs as $nick => $class) { |
||
19 | // get comment |
||
20 | $reflection = new ReflectionClass($class); |
||
21 | $comments = []; |
||
22 | foreach(explode(PHP_EOL, $reflection->getDocComment()) as $line) { |
||
23 | if(!in_array(substr($line, 0, 3), ['/**', ' */'])) { |
||
24 | $comments[] = trim(substr($line, 2)); |
||
25 | } |
||
26 | } |
||
27 | $comment = implode(PHP_EOL, $comments); |
||
28 | if(!$comment) { |
||
29 | $comment = '-'; |
||
30 | } |
||
31 | $info[] = compact('nick', 'class', 'comment'); |
||
32 | } |
||
33 | |||
34 | return compact('info'); |
||
35 | } |
||
36 | } |