| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function hydrateCommands(array $commands) : array |
||
| 33 | { |
||
| 34 | $modulesDone = []; |
||
| 35 | |||
| 36 | foreach ($this->finder->getModuleList() as $module) { |
||
| 37 | $moduleName = basename($module); |
||
| 38 | |||
| 39 | if (!\in_array($moduleName, $modulesDone, true)) { |
||
| 40 | $facade = Locator::getInstance()->{$moduleName}()->facade(); |
||
| 41 | if (method_exists($facade, 'getCommands')) { |
||
| 42 | $commands = \array_merge($commands, $facade->getCommands()); |
||
| 43 | } |
||
| 44 | $modulesDone[] = $moduleName; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | return $commands; |
||
| 49 | } |
||
| 50 | } |