File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -95,22 +95,25 @@ public static function load(Ruleset $ruleset, Config $config)
95
95
// hash. This ensures that core PHPCS changes will also invalidate the cache.
96
96
// Note that we ignore sniffs here, and any files that don't affect
97
97
// the outcome of the run.
98
- $ di = new \RecursiveDirectoryIterator ($ installDir );
98
+ $ di = new \RecursiveDirectoryIterator (
99
+ $ installDir ,
100
+ (\FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS )
101
+ );
99
102
$ filter = new \RecursiveCallbackFilterIterator (
100
103
$ di ,
101
104
function ($ file , $ key , $ iterator ) {
102
- // Skip hidden files.
105
+ // Skip non-php files.
103
106
$ filename = $ file ->getFilename ();
104
- if (substr ($ filename , 0 , 1 ) === '. ' ) {
107
+ if ($ file -> isFile () === true && substr ($ filename , - 4 ) !== '.php ' ) {
105
108
return false ;
106
109
}
107
110
108
- $ filePath = Common::realpath ($ file -> getPathname () );
111
+ $ filePath = Common::realpath ($ key );
109
112
if ($ filePath === false ) {
110
113
return false ;
111
114
}
112
115
113
- if (is_dir ( $ filePath ) === true
116
+ if ($ iterator -> hasChildren ( ) === true
114
117
&& ($ filename === 'Standards '
115
118
|| $ filename === 'Exceptions '
116
119
|| $ filename === 'Reports '
You can’t perform that action at this time.
0 commit comments