| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| 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)) { |
||
| 40 | $facade = Locator::getInstance()->{$moduleName}()->facade(); |
||
| 41 | if (method_exists($facade, 'getCommands')) { |
||
| 42 | $commands = array_merge($commands, $facade->getCommands()); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | return $commands; |
||
| 48 | } |
||
| 49 | } |