Skip to content

Commit

Permalink
Merge branch '10.1' into 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 8, 2025
2 parents a9a715d + 89e6947 commit 532c902
Show file tree
Hide file tree
Showing 6 changed files with 6 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>
1 change: 1 addition & 0 deletions ChangeLog-11.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt

### Changed

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

## [11.0.8] - 2024-12-11
Expand Down
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 @@ -32,7 +32,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 @@ -173,7 +172,7 @@ private function cacheFile(string $filename): string
[
$filename,
file_get_contents($filename),
self::cacheVersion(),
Version::id(),
$this->useAnnotationsForIgnoringCode,
$this->ignoreDeprecatedCode,
],
Expand All @@ -182,22 +181,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 532c902

Please sign in to comment.