Skip to content

Commit

Permalink
Merge branch '11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 8, 2025
2 parents 89d8cb2 + 532c902 commit 8a265f2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^3.65" installed="3.66.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="composer" version="^2.8" installed="2.8.4" location="./tools/composer" copy="true"/>
<phar name="phpstan" version="^2.0" installed="2.1.1" location="./tools/phpstan" copy="true"/>
<phar name="php-cs-fixer" version="^3.65" installed="3.68.5" location="./tools/php-cs-fixer" copy="true"/>
<phar name="composer" version="^2.8" installed="2.8.5" location="./tools/composer" copy="true"/>
<phar name="phpstan" version="^2.0" installed="2.1.3" location="./tools/phpstan" copy="true"/>
</phive>
7 changes: 7 additions & 0 deletions ChangeLog-12.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## [12.0.2] - 2025-MM-DD

### Changed

* Changed version identifier for static analysis cache from "MD5 over source code" to `Version::id()`

## [12.0.1] - 2025-02-07

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

[12.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/12.0.1...main
[12.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/12.0.0...12.0.1
[12.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/11.0...12.0.0
23 changes: 2 additions & 21 deletions src/StaticAnalysis/CachingFileAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use function serialize;
use function unserialize;
use SebastianBergmann\CodeCoverage\Util\Filesystem;
use SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
use SebastianBergmann\CodeCoverage\Version;

/**
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
Expand All @@ -37,7 +37,6 @@
*/
final class CachingFileAnalyser implements FileAnalyser
{
private static ?string $cacheVersion = null;
private readonly string $directory;
private readonly FileAnalyser $analyser;
private readonly bool $useAnnotationsForIgnoringCode;
Expand Down Expand Up @@ -207,7 +206,7 @@ private function cacheFile(string $filename): string
[
$filename,
file_get_contents($filename),
self::cacheVersion(),
Version::id(),
$this->useAnnotationsForIgnoringCode,
$this->ignoreDeprecatedCode,
],
Expand All @@ -216,22 +215,4 @@ private function cacheFile(string $filename): string

return $this->directory . DIRECTORY_SEPARATOR . $cacheKey;
}

private static function cacheVersion(): string
{
if (self::$cacheVersion !== null) {
return self::$cacheVersion;
}

$buffer = [];

foreach ((new FileIteratorFacade)->getFilesAsArray(__DIR__, '.php') as $file) {
$buffer[] = $file;
$buffer[] = file_get_contents($file);
}

self::$cacheVersion = md5(implode("\0", $buffer));

return self::$cacheVersion;
}
}
Binary file modified tools/composer
Binary file not shown.
Binary file modified tools/php-cs-fixer
Binary file not shown.
Binary file modified tools/phpstan
Binary file not shown.

0 comments on commit 8a265f2

Please sign in to comment.