Skip to content

Commit

Permalink
The PHPCS file cache now takes file permissions into account
Browse files Browse the repository at this point in the history
Allows sniffs that check file perms to remain in the cache
  • Loading branch information
gsherwood committed Nov 12, 2019
1 parent 5960500 commit 8f4ec56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- The token after the statement (normally a semicolon) becomes the scope closer
-- The token is also associated with the opening and closing parenthesis of the statement
-- Any functions named "fn" will cause have a T_FN token for the function name, but have no scope information
- The PHPCS file cache now takes file permissions into account
-- The cache is now invalidated for a file when its permissions are changed
- File::getMethodParameters() now supports arrow functions
- File::getMethodProperties() now supports arrow functions
- Generic.CodeAnalysis.EmptyPhpStatement now reports unnecessary semicolons after control structure closing braces
Expand Down
1 change: 1 addition & 0 deletions src/Files/LocalFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public function process()
}

$hash = md5_file($this->path);
$hash .= fileperms($this->path);
$cache = Cache::get($this->path);
if ($cache !== false && $cache['hash'] === $hash) {
// We can't filter metrics, so just load all of them.
Expand Down

0 comments on commit 8f4ec56

Please sign in to comment.