Skip to content

Commit 8bd89ce

Browse files
committed
MQE-526: Do not depend on xml merging by filename-order
- PHPMD fix for cyclomatic complexity.
1 parent c9cda12 commit 8bd89ce

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,20 @@ public function getModulesPath()
209209
}
210210

211211
$enabledModules = array_merge($enabledModules, $this->getModuleWhitelist());
212+
$enabledDirectoryPaths = $this->getEnabledDirectoryPaths($enabledModules, $allModulePaths);
213+
214+
$this->enabledModulePaths = $this->applyCustomModuleMethods($enabledDirectoryPaths);
215+
return $this->enabledModulePaths;
216+
}
217+
218+
/**
219+
* Runs through enabled modules and maps them known module paths by name.
220+
* @param array $enabledModules
221+
* @param array $allModulePaths
222+
* @return array
223+
*/
224+
private function getEnabledDirectoryPaths($enabledModules, $allModulePaths)
225+
{
212226
$enabledDirectoryPaths = [];
213227
foreach ($enabledModules as $magentoModuleName) {
214228
$moduleShortName = explode('_', $magentoModuleName)[1];
@@ -218,9 +232,7 @@ public function getModulesPath()
218232
$enabledDirectoryPaths[$moduleShortName] = $allModulePaths[$moduleShortName];
219233
}
220234
}
221-
222-
$this->enabledModulePaths = $this->applyCustomModuleMethods($enabledDirectoryPaths);
223-
return $this->enabledModulePaths;
235+
return $enabledDirectoryPaths;
224236
}
225237

226238
/**

0 commit comments

Comments
 (0)