Skip to content

Commit e720b68

Browse files
authored
#24686: Static Content Deploy - Optimize files scanning performance
- Fix static test failures - Ignore using array_merge in loop for now
1 parent 2b33196 commit e720b68

File tree

1 file changed

+4
-24
lines changed
  • lib/internal/Magento/Framework/App/Utility

1 file changed

+4
-24
lines changed

lib/internal/Magento/Framework/App/Utility/Files.php

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,20 @@
2424
*/
2525
class Files
2626
{
27-
/**
28-
* Include app code
29-
*/
3027
const INCLUDE_APP_CODE = 1;
3128

32-
/**
33-
* Include tests
34-
*/
3529
const INCLUDE_TESTS = 2;
3630

37-
/**
38-
* Include dev tools
39-
*/
4031
const INCLUDE_DEV_TOOLS = 4;
4132

42-
/**
43-
* Include templates
44-
*/
4533
const INCLUDE_TEMPLATES = 8;
4634

47-
/**
48-
* Include lib files
49-
*/
5035
const INCLUDE_LIBS = 16;
5136

52-
/**
53-
* Include pub code
54-
*/
5537
const INCLUDE_PUB_CODE = 32;
5638

57-
/**
58-
* Include non classes
59-
*/
6039
const INCLUDE_NON_CLASSES = 64;
6140

62-
/**
63-
* Include setup
64-
*/
6541
const INCLUDE_SETUP = 128;
6642

6743
/**
@@ -397,6 +373,7 @@ public function getMainConfigFiles($asDataSet = true)
397373
$configXmlPaths = array_merge($globPaths, $configXmlPaths);
398374
$files = [];
399375
foreach ($configXmlPaths as $xmlPath) {
376+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
400377
$files = array_merge($files, glob($xmlPath, GLOB_NOSORT));
401378
}
402379
self::$_cache[$cacheKey] = $files;
@@ -679,6 +656,7 @@ private function collectModuleLayoutFiles(array $params, $location)
679656
}
680657
}
681658
} else {
659+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
682660
$files = array_merge($files, $moduleFiles);
683661
}
684662
}
@@ -713,8 +691,10 @@ private function collectThemeLayoutFiles(array $params, $location)
713691
);
714692

715693
if ($params['with_metainfo']) {
694+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
716695
$files = array_merge($this->parseThemeFiles($themeFiles, $currentThemePath, $theme));
717696
} else {
697+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
718698
$files = array_merge($files, $themeFiles);
719699
}
720700
}

0 commit comments

Comments
 (0)