File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
dev/tests/static/testsuite/Magento/Test/GraphQl Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -173,27 +173,22 @@ private static function getClassNameWithNamespace(string $filePath): string
173
173
*/
174
174
private static function isFrontendUIComponent (string $ moduleName , string $ className ): bool
175
175
{
176
- if (isset (self ::$ frontendUIComponent [$ moduleName ])) {
177
- $ frontendUIComponent = self ::$ frontendUIComponent [$ moduleName ];
178
- } else {
179
- $ frontendUIComponent = [];
176
+ if (!isset (self ::$ frontendUIComponent [$ moduleName ])) {
180
177
$ files = glob (BP . '/app/code/Magento/ ' .$ moduleName .'/view/frontend/*/*.xml ' );
181
178
182
179
if (is_array ($ files )) {
183
180
$ uIComponentClasses = [];
181
+
184
182
foreach ($ files as $ filename ) {
185
- $ xml = simplexml_load_file ($ filename );
186
- $ uIComponentClasses [] = $ xml ->xpath ('//@class ' );
183
+ $ uIComponentClasses [] = simplexml_load_file ($ filename )->xpath ('//@class ' );
187
184
}
188
- $ frontendUIComponent = array_unique (array_merge ([], ...$ uIComponentClasses ));
189
- self ::$ frontendUIComponent [$ moduleName ] = self ::filterUiComponents ($ frontendUIComponent , $ moduleName );
185
+ self ::$ frontendUIComponent [$ moduleName ] = self ::filterUiComponents (
186
+ array_unique (array_merge ([], ...$ uIComponentClasses )),
187
+ $ moduleName
188
+ );
190
189
}
191
190
}
192
-
193
- if (in_array ($ className , $ frontendUIComponent )) {
194
- return true ;
195
- }
196
- return false ;
191
+ return in_array ($ className , self ::$ frontendUIComponent [$ moduleName ]);
197
192
}
198
193
199
194
/**
You can’t perform that action at this time.
0 commit comments