@@ -85,6 +85,21 @@ public static function getWhitelist($fileTypes = ['php'], $changedFilesBaseDir =
85
85
return $ targetFiles ;
86
86
}
87
87
88
+ /**
89
+ * This method loads list of changed files.
90
+ *
91
+ * List may be generated by:
92
+ * - dev/tests/static/get_github_changes.php utility (allow to generate diffs between branches),
93
+ * - CLI command "git diff --name-only > dev/tests/static/testsuite/Magento/Test/_files/changed_files_local.txt",
94
+ *
95
+ * If no generated changed files list found "git diff" will be used to find not committed changed
96
+ * (tests should be invoked from target gir repo).
97
+ *
98
+ * Note: "static" modifier used for compatibility with legacy implementation of self::getWhitelist method
99
+ *
100
+ * @param string $changedFilesBaseDir Base dir with previously generated list files
101
+ * @return string[] List of changed files
102
+ */
88
103
private static function getChangedFilesList ($ changedFilesBaseDir )
89
104
{
90
105
$ changedFiles = [];
@@ -113,6 +128,21 @@ function (&$file) {
113
128
return $ changedFiles ;
114
129
}
115
130
131
+ /**
132
+ * Filter list of files.
133
+ *
134
+ * File removed from list:
135
+ * - if it not exists,
136
+ * - if allowed types are specified and file has another type (extension),
137
+ * - if allowed directories specified and file not located in one of them.
138
+ *
139
+ * Note: "static" modifier used for compatibility with legacy implementation of self::getWhitelist method
140
+ *
141
+ * @param string[] $files List of file paths to filter
142
+ * @param string[] $allowedFileTypes List of allowed file extensions (pass empty array to allow all)
143
+ * @param string[] $allowedDirectories List of allowed directories (pass empty array to allow all)
144
+ * @return string[] Filtered file paths
145
+ */
116
146
private static function filterFiles (array $ files , array $ allowedFileTypes , array $ allowedDirectories )
117
147
{
118
148
if (empty ($ allowedFileTypes )) {
0 commit comments