Skip to content

Commit ede68c9

Browse files
Closes #1143
1 parent 48b3393 commit ede68c9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ChangeLog-13.0.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
44

5+
## [13.0.2] - 2026-MM-DD
6+
7+
### Fixed
8+
9+
* [#1143](https://github.com/sebastianbergmann/php-code-coverage/issues/1143): Race condition in `CachingSourceAnalyser::read()` with parallel test runners
10+
511
## [13.0.1] - 2026-02-06
612

713
### Fixed
@@ -14,5 +20,6 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
1420

1521
* This component is no longer supported on PHP 8.3
1622

23+
[13.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/13.0.1...13.0
1724
[13.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/13.0.0...13.0.1
1825
[13.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/12.5...13.0.0

src/StaticAnalysis/CachingSourceAnalyser.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,14 @@ private function read(string $cacheFile): AnalysisResult|false
107107
return false;
108108
}
109109

110+
$data = file_get_contents($cacheFile);
111+
112+
if ($data === false) {
113+
return false;
114+
}
115+
110116
return unserialize(
111-
file_get_contents($cacheFile),
117+
$data,
112118
[
113119
'allowed_classes' => [
114120
AnalysisResult::class,

0 commit comments

Comments
 (0)