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