Skip to content

Commit ae451d2

Browse files
authored
Use relative file path as the cache key
1 parent 5c22aec commit ae451d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Linter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ public function lint($files = [], $cache = true)
9696
for ($i = count($running); !empty($files) && $i < $this->processLimit; ++$i) {
9797
$file = array_shift($files);
9898
$filename = $file->getRealPath();
99-
100-
if (!isset($this->cache[$filename]) || $this->cache[$filename] !== md5_file($filename)) {
99+
$key = $file->getRelativePathname();
100+
if (!isset($this->cache[$key]) || $this->cache[$key] !== md5_file($filename)) {
101101
$lint = new Lint(escapeshellcmd($phpbin).' -d error_reporting=E_ALL -d display_errors=On -l '.escapeshellarg($filename));
102-
$running[$filename] = [
102+
$running[$key] = [
103103
'process' => $lint,
104104
'file' => $file,
105105
];
106106
$lint->start();
107107
} else {
108-
$newCache[$filename] = $this->cache[$filename];
108+
$newCache[$key] = $this->cache[$key];
109109
}
110110
}
111111

0 commit comments

Comments
 (0)