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 1616 */
1717final class CachingCoveredFileAnalyser extends Cache implements CoveredFileAnalyser
1818{
19+ private const CACHE_FORMAT_VERSION = 2 ;
20+
1921 /**
2022 * @var CoveredFileAnalyser
2123 */
@@ -80,8 +82,10 @@ public function ignoredLinesFor(string $filename): array
8082
8183 public function process (string $ filename ): void
8284 {
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]);
8589
8690 return ;
8791 }
@@ -94,6 +98,6 @@ public function process(string $filename): void
9498 'ignoredLinesFor ' => $ this ->coveredFileAnalyser ->ignoredLinesFor ($ filename ),
9599 ];
96100
97- $ this ->write ($ filename , __CLASS__ , $ this ->cache [$ filename ]);
101+ $ this ->write ($ filename , $ cacheKey , $ this ->cache [$ filename ]);
98102 }
99103}
You can’t perform that action at this time.
0 commit comments