File tree 4 files changed +16
-27
lines changed
framework/Magento/TestFramework/Utility
lib/internal/Magento/Framework/Test/Utility 4 files changed +16
-27
lines changed Original file line number Diff line number Diff line change @@ -23,21 +23,14 @@ class ChangedFiles
23
23
public static function getPhpFiles ($ changedFilesList )
24
24
{
25
25
$ fileHelper = \Magento \Framework \Test \Utility \Files::init ();
26
- $ allPhpFiles = $ fileHelper ->getPhpFiles ();
27
26
if (isset ($ _ENV ['INCREMENTAL_BUILD ' ])) {
28
- try {
29
- $ phpFiles = Files:: readLists ( $ changedFilesList );
30
- } catch ( \ Exception $ e ){
31
- $ phpFiles = [] ;
27
+ $ phpFiles = Files:: readLists ( $ changedFilesList );
28
+ if (! empty ( $ phpFiles )) {
29
+ $ phpFiles = \ Magento \ Framework \ Test \ Utility \Files:: composeDataSets ( $ phpFiles );
30
+ $ phpFiles = array_intersect_key ( $ phpFiles , $ fileHelper -> getPhpFiles ()) ;
32
31
}
33
-
34
- foreach ($ phpFiles as $ key => $ phpFile ) {
35
- $ phpFiles [$ key ] = $ fileHelper ->getPathToSource () . '/ ' . $ phpFile ;
36
- }
37
- $ phpFiles = \Magento \Framework \Test \Utility \Files::composeDataSets ($ phpFiles );
38
- $ phpFiles = array_intersect_key ($ phpFiles , $ allPhpFiles );
39
32
} else {
40
- $ phpFiles = $ allPhpFiles ;
33
+ $ phpFiles = $ fileHelper -> getPhpFiles () ;
41
34
}
42
35
43
36
return $ phpFiles ;
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ function ($file) {
129
129
$ this ->_testObsoleteConstants ($ content );
130
130
$ this ->_testObsoletePropertySkipCalculate ($ content );
131
131
},
132
- \Magento \TestFramework \Utility \ChangedFiles::getPhpFiles (__DIR__ . '/_files/changed_files ' )
132
+ \Magento \TestFramework \Utility \ChangedFiles::getPhpFiles (__DIR__ . '/_files/changed_files* ' )
133
133
);
134
134
}
135
135
Original file line number Diff line number Diff line change @@ -52,21 +52,17 @@ public static function getWhitelist($fileTypes = ['php'])
52
52
{
53
53
$ directoriesToCheck = file (__DIR__ . '/_files/whitelist/common.txt ' , FILE_IGNORE_NEW_LINES );
54
54
55
- try {
56
- $ changedFiles = array_filter (
57
- Utility \Files::readLists (__DIR__ . '/_files/changed_files ' ),
58
- function ($ path ) use ($ directoriesToCheck ) {
59
- foreach ($ directoriesToCheck as $ directory ) {
60
- if (strpos ($ path , BP . '/ ' . $ directory ) === 0 ) {
61
- return true ;
62
- }
55
+ $ changedFiles = array_filter (
56
+ Utility \Files::readLists (__DIR__ . '/_files/changed_files* ' ),
57
+ function ($ path ) use ($ directoriesToCheck ) {
58
+ foreach ($ directoriesToCheck as $ directory ) {
59
+ if (strpos ($ path , BP . '/ ' . $ directory ) === 0 ) {
60
+ return true ;
63
61
}
64
- return false ;
65
62
}
66
- );
67
- } catch (\Exception $ e ) {
68
- $ changedFiles = [];
69
- }
63
+ return false ;
64
+ }
65
+ );
70
66
71
67
if (!empty ($ fileTypes )) {
72
68
$ changedFiles = array_filter (
Original file line number Diff line number Diff line change @@ -1068,7 +1068,7 @@ public static function readLists($globPattern)
1068
1068
*/
1069
1069
$ files = glob (self ::init ()->getPathToSource () . '/ ' . $ pattern , GLOB_BRACE );
1070
1070
if (empty ($ files )) {
1071
- throw new \ Exception ( " The glob() pattern ' { $ pattern } ' didn't return any result. " ) ;
1071
+ continue ;
1072
1072
}
1073
1073
$ result = array_merge ($ result , $ files );
1074
1074
}
You can’t perform that action at this time.
0 commit comments