Skip to content

Commit 532c902

Browse files
Merge branch '10.1' into 11.0
2 parents a9a715d + 89e6947 commit 532c902

File tree

6 files changed

+6
-24
lines changed

6 files changed

+6
-24
lines changed

Diff for: .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>

Diff for: ChangeLog-11.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
66

77
### Changed
88

9+
* Changed version identifier for static analysis cache from "MD5 over source code" to `Version::id()`
910
* The `SebastianBergmann\CodeCoverage\Filter::includeUncoveredFiles()` and `SebastianBergmann\CodeCoverage\Filter::excludeUncoveredFiles()` methods are no longer deprecated
1011

1112
## [11.0.8] - 2024-12-11

Diff for: 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
@@ -32,7 +32,6 @@
3232
*/
3333
final class CachingFileAnalyser implements FileAnalyser
3434
{
35-
private static ?string $cacheVersion = null;
3635
private readonly string $directory;
3736
private readonly FileAnalyser $analyser;
3837
private readonly bool $useAnnotationsForIgnoringCode;
@@ -173,7 +172,7 @@ private function cacheFile(string $filename): string
173172
[
174173
$filename,
175174
file_get_contents($filename),
176-
self::cacheVersion(),
175+
Version::id(),
177176
$this->useAnnotationsForIgnoringCode,
178177
$this->ignoreDeprecatedCode,
179178
],
@@ -182,22 +181,4 @@ private function cacheFile(string $filename): string
182181

183182
return $this->directory . DIRECTORY_SEPARATOR . $cacheKey;
184183
}
185-
186-
private static function cacheVersion(): string
187-
{
188-
if (self::$cacheVersion !== null) {
189-
return self::$cacheVersion;
190-
}
191-
192-
$buffer = [];
193-
194-
foreach ((new FileIteratorFacade)->getFilesAsArray(__DIR__, '.php') as $file) {
195-
$buffer[] = $file;
196-
$buffer[] = file_get_contents($file);
197-
}
198-
199-
self::$cacheVersion = md5(implode("\0", $buffer));
200-
201-
return self::$cacheVersion;
202-
}
203184
}

Diff for: tools/composer

-2.49 KB
Binary file not shown.

Diff for: tools/php-cs-fixer

1.59 KB
Binary file not shown.

Diff for: tools/phpstan

79 KB
Binary file not shown.

0 commit comments

Comments
 (0)