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