Skip to content

Commit 41c318b

Browse files
committed
MC-35885: Process public PR with bin/magento improvements
1 parent cb03642 commit 41c318b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/internal/Magento/Framework/Module/ModuleList.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\App\DeploymentConfig;
99
use Magento\Framework\Config\ConfigOptionsListConstants;
10+
use Magento\Framework\Module\ModuleList\Loader;
1011

1112
/**
1213
* A list of modules in the Magento application
@@ -26,7 +27,7 @@ class ModuleList implements ModuleListInterface
2627
/**
2728
* Loader of module information from source code
2829
*
29-
* @var ModuleList\Loader
30+
* @var Loader
3031
*/
3132
private $loader;
3233

@@ -50,9 +51,9 @@ class ModuleList implements ModuleListInterface
5051
* Constructor
5152
*
5253
* @param DeploymentConfig $config
53-
* @param ModuleList\Loader $loader
54+
* @param Loader $loader
5455
*/
55-
public function __construct(DeploymentConfig $config, ModuleList\Loader $loader)
56+
public function __construct(DeploymentConfig $config, Loader $loader)
5657
{
5758
$this->config = $config;
5859
$this->loader = $loader;
@@ -98,10 +99,17 @@ public function getOne($name)
9899
public function getNames()
99100
{
100101
$this->loadConfigData();
102+
103+
$modulesList = array_keys($this->loader->load());
104+
101105
if (!$this->configData) {
102106
return [];
103107
}
104-
$result = array_keys(array_filter($this->configData));
108+
109+
$modulesInConfig = array_keys(array_filter($this->configData));
110+
111+
$result = array_intersect($modulesInConfig, $modulesList);
112+
105113
return $result;
106114
}
107115

0 commit comments

Comments
 (0)