Conditions | 5 |
Paths | 9 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
12 | 2 | public function run(Filesystem $fs, Config $config) |
|
|
|||
13 | { |
||
14 | 2 | $routes = []; |
|
15 | 2 | foreach ($fs->listClasses('Controller') as $class) { |
|
16 | 2 | $nick = substr(strtolower($class), 11); |
|
17 | 2 | $methods = (new ReflectionClass($class))->getMethods(ReflectionMethod::IS_PUBLIC); |
|
18 | 2 | foreach ($methods as $method) { |
|
19 | 2 | $routes[] = $nick.'/'.$method->getName(); |
|
20 | } |
||
21 | } |
||
22 | |||
23 | 2 | $jobs = []; |
|
24 | 2 | foreach ($fs->listClasses('Job') as $class) { |
|
25 | 2 | $reflection = new ReflectionClass($class); |
|
26 | 2 | if (!$reflection->isAbstract()) { |
|
27 | 2 | $jobs[] = str_replace('\\', '.', substr(strtolower($class), 4)); |
|
28 | } |
||
29 | } |
||
30 | |||
31 | 2 | return compact('routes', 'jobs'); |
|
32 | } |
||
33 | } |
||
34 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.