File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
final class CachingCoveredFileAnalyser extends Cache implements CoveredFileAnalyser
18
18
{
19
+ private const CACHE_FORMAT_VERSION = 2 ;
20
+
19
21
/**
20
22
* @var CoveredFileAnalyser
21
23
*/
@@ -80,8 +82,10 @@ public function ignoredLinesFor(string $filename): array
80
82
81
83
public function process (string $ filename ): void
82
84
{
83
- if ($ this ->has ($ filename , __CLASS__ )) {
84
- $ this ->cache [$ filename ] = $ this ->read ($ filename , __CLASS__ , [LinesOfCode::class]);
85
+ $ cacheKey = __CLASS__ . self ::CACHE_FORMAT_VERSION ;
86
+
87
+ if ($ this ->has ($ filename , $ cacheKey )) {
88
+ $ this ->cache [$ filename ] = $ this ->read ($ filename , $ cacheKey , [LinesOfCode::class]);
85
89
86
90
return ;
87
91
}
@@ -94,6 +98,6 @@ public function process(string $filename): void
94
98
'ignoredLinesFor ' => $ this ->coveredFileAnalyser ->ignoredLinesFor ($ filename ),
95
99
];
96
100
97
- $ this ->write ($ filename , __CLASS__ , $ this ->cache [$ filename ]);
101
+ $ this ->write ($ filename , $ cacheKey , $ this ->cache [$ filename ]);
98
102
}
99
103
}
You can’t perform that action at this time.
0 commit comments