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
173173 */
174174 private static function isFrontendUIComponent (string $ moduleName , string $ className ): bool
175175 {
176- if (isset (self ::$ frontendUIComponent [$ moduleName ])) {
177- $ frontendUIComponent = self ::$ frontendUIComponent [$ moduleName ];
178- } else {
179- $ frontendUIComponent = [];
176+ if (!isset (self ::$ frontendUIComponent [$ moduleName ])) {
180177 $ files = glob (BP . '/app/code/Magento/ ' .$ moduleName .'/view/frontend/*/*.xml ' );
181178
182179 if (is_array ($ files )) {
183180 $ uIComponentClasses = [];
181+
184182 foreach ($ files as $ filename ) {
185- $ xml = simplexml_load_file ($ filename );
186- $ uIComponentClasses [] = $ xml ->xpath ('//@class ' );
183+ $ uIComponentClasses [] = simplexml_load_file ($ filename )->xpath ('//@class ' );
187184 }
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+ );
190189 }
191190 }
192-
193- if (in_array ($ className , $ frontendUIComponent )) {
194- return true ;
195- }
196- return false ;
191+ return in_array ($ className , self ::$ frontendUIComponent [$ moduleName ]);
197192 }
198193
199194 /**
You can’t perform that action at this time.
0 commit comments