Skip to content

Commit 8a265f2

Browse files
Merge branch '11.0'
2 parents 89d8cb2 + 532c902 commit 8a265f2

File tree

6 files changed

+12
-24
lines changed

6 files changed

+12
-24
lines changed

.phive/phars.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.65" installed="3.66.1" location="./tools/php-cs-fixer" copy="true"/>
4-
<phar name="composer" version="^2.8" installed="2.8.4" location="./tools/composer" copy="true"/>
5-
<phar name="phpstan" version="^2.0" installed="2.1.1" location="./tools/phpstan" copy="true"/>
3+
<phar name="php-cs-fixer" version="^3.65" installed="3.68.5" location="./tools/php-cs-fixer" copy="true"/>
4+
<phar name="composer" version="^2.8" installed="2.8.5" location="./tools/composer" copy="true"/>
5+
<phar name="phpstan" version="^2.0" installed="2.1.3" location="./tools/phpstan" copy="true"/>
66
</phive>

ChangeLog-12.0.md

+7
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+
## [12.0.2] - 2025-MM-DD
6+
7+
### Changed
8+
9+
* Changed version identifier for static analysis cache from "MD5 over source code" to `Version::id()`
10+
511
## [12.0.1] - 2025-02-07
612

713
### Fixed
@@ -21,5 +27,6 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
2127
* This component is no longer supported on PHP 8.2
2228
* This component no longer supports Xdebug versions before Xdebug 3.1
2329

30+
[12.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/12.0.1...main
2431
[12.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/12.0.0...12.0.1
2532
[12.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/11.0...12.0.0

src/StaticAnalysis/CachingFileAnalyser.php

+2-21
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use function serialize;
1919
use function unserialize;
2020
use SebastianBergmann\CodeCoverage\Util\Filesystem;
21-
use SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
21+
use SebastianBergmann\CodeCoverage\Version;
2222

2323
/**
2424
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
@@ -37,7 +37,6 @@
3737
*/
3838
final class CachingFileAnalyser implements FileAnalyser
3939
{
40-
private static ?string $cacheVersion = null;
4140
private readonly string $directory;
4241
private readonly FileAnalyser $analyser;
4342
private readonly bool $useAnnotationsForIgnoringCode;
@@ -207,7 +206,7 @@ private function cacheFile(string $filename): string
207206
[
208207
$filename,
209208
file_get_contents($filename),
210-
self::cacheVersion(),
209+
Version::id(),
211210
$this->useAnnotationsForIgnoringCode,
212211
$this->ignoreDeprecatedCode,
213212
],
@@ -216,22 +215,4 @@ private function cacheFile(string $filename): string
216215

217216
return $this->directory . DIRECTORY_SEPARATOR . $cacheKey;
218217
}
219-
220-
private static function cacheVersion(): string
221-
{
222-
if (self::$cacheVersion !== null) {
223-
return self::$cacheVersion;
224-
}
225-
226-
$buffer = [];
227-
228-
foreach ((new FileIteratorFacade)->getFilesAsArray(__DIR__, '.php') as $file) {
229-
$buffer[] = $file;
230-
$buffer[] = file_get_contents($file);
231-
}
232-
233-
self::$cacheVersion = md5(implode("\0", $buffer));
234-
235-
return self::$cacheVersion;
236-
}
237218
}

tools/composer

-2.49 KB
Binary file not shown.

tools/php-cs-fixer

1.59 KB
Binary file not shown.

tools/phpstan

79 KB
Binary file not shown.

0 commit comments

Comments
 (0)