Skip to content

Commit

Permalink
CachingUncoveredFileAnalyser: ensure next release gets fresh cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Feb 10, 2022
1 parent 2f8bbbd commit 07df4ac
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/StaticAnalysis/CachingUncoveredFileAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ public function __construct(string $directory, UncoveredFileAnalyser $uncoveredF

public function executableLinesIn(string $filename): array
{
if ($this->has($filename, __METHOD__)) {
return $this->read($filename, __METHOD__);
$cacheKey = 'v2' . __METHOD__;

if ($this->has($filename, $cacheKey)) {
return $this->read($filename, $cacheKey);
}

$data = $this->uncoveredFileAnalyser->executableLinesIn($filename);

$this->write($filename, __METHOD__, $data);
$this->write($filename, $cacheKey, $data);

return $data;
}
Expand Down

0 comments on commit 07df4ac

Please sign in to comment.