Skip to content

Commit

Permalink
Result caching: minor optimization tweak [1]
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed Jun 24, 2020
1 parent a957a73 commit 5ee7531
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Util/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ function ($file, $key, $iterator) {
return false;
}

// Skip non-php files.
if ($file->isFile() === true && substr($filename, -4) !== '.php') {
return false;
}

$filePath = Common::realpath($file->getPathname());
if ($filePath === false) {
return false;
Expand Down

0 comments on commit 5ee7531

Please sign in to comment.