Skip to content

Commit 8f4ec56

Browse files
committed
The PHPCS file cache now takes file permissions into account
Allows sniffs that check file perms to remain in the cache
1 parent 5960500 commit 8f4ec56

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
3232
-- The token after the statement (normally a semicolon) becomes the scope closer
3333
-- The token is also associated with the opening and closing parenthesis of the statement
3434
-- Any functions named "fn" will cause have a T_FN token for the function name, but have no scope information
35+
- The PHPCS file cache now takes file permissions into account
36+
-- The cache is now invalidated for a file when its permissions are changed
3537
- File::getMethodParameters() now supports arrow functions
3638
- File::getMethodProperties() now supports arrow functions
3739
- Generic.CodeAnalysis.EmptyPhpStatement now reports unnecessary semicolons after control structure closing braces

src/Files/LocalFile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public function process()
9393
}
9494

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

0 commit comments

Comments
 (0)