Skip to content

Commit 5ee7531

Browse files
committed
Result caching: minor optimization tweak [1]
While debugging something else, I noticed that `.bak` files were being used for the "PHPCS native file hash". As non-php files in the PHPCS directories have no effect on the actual run output, we may as well skip them from being part of the hash.
1 parent a957a73 commit 5ee7531

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Util/Cache.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ function ($file, $key, $iterator) {
105105
return false;
106106
}
107107

108+
// Skip non-php files.
109+
if ($file->isFile() === true && substr($filename, -4) !== '.php') {
110+
return false;
111+
}
112+
108113
$filePath = Common::realpath($file->getPathname());
109114
if ($filePath === false) {
110115
return false;

0 commit comments

Comments
 (0)