Skip to content

Commit b24efec

Browse files
committed
MC-35885: Process public PR with bin/magento improvements
1 parent a00482d commit b24efec

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

lib/internal/Magento/Framework/Module/Dir/Reader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ private function getFiles($filename, $subDir = '')
124124
{
125125
$result = [];
126126
foreach ($this->modulesList->getNames() as $moduleName) {
127-
$moduleSubDir = $this->getModuleDir($subDir, $moduleName);
127+
try {
128+
$moduleSubDir = $this->getModuleDir($subDir, $moduleName);
129+
} catch (\InvalidArgumentException $e) {
130+
continue;
131+
}
128132
$file = $moduleSubDir . '/' . $filename;
129133
$directoryRead = $this->readFactory->create($moduleSubDir);
130134
$path = $directoryRead->getRelativePath($file);

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

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

88
use Magento\Framework\App\DeploymentConfig;
99
use Magento\Framework\Config\ConfigOptionsListConstants;
10-
use Magento\Framework\Module\ModuleList\Loader;
1110

1211
/**
1312
* A list of modules in the Magento application
@@ -27,7 +26,7 @@ class ModuleList implements ModuleListInterface
2726
/**
2827
* Loader of module information from source code
2928
*
30-
* @var Loader
29+
* @var ModuleList\Loader
3130
*/
3231
private $loader;
3332

@@ -51,9 +50,9 @@ class ModuleList implements ModuleListInterface
5150
* Constructor
5251
*
5352
* @param DeploymentConfig $config
54-
* @param Loader $loader
53+
* @param ModuleList\Loader $loader
5554
*/
56-
public function __construct(DeploymentConfig $config, Loader $loader)
55+
public function __construct(DeploymentConfig $config, ModuleList\Loader $loader)
5756
{
5857
$this->config = $config;
5958
$this->loader = $loader;
@@ -99,17 +98,10 @@ public function getOne($name)
9998
public function getNames()
10099
{
101100
$this->loadConfigData();
102-
103-
$modulesList = array_keys($this->loader->load());
104-
105101
if (!$this->configData) {
106102
return [];
107103
}
108-
109-
$modulesInConfig = array_keys(array_filter($this->configData));
110-
111-
$result = array_intersect($modulesInConfig, $modulesList);
112-
104+
$result = array_keys(array_filter($this->configData));
113105
return $result;
114106
}
115107

0 commit comments

Comments
 (0)