Skip to content

Commit

Permalink
Fix ResultCacheManager for ever-changing Git commit in vendor/compose…
Browse files Browse the repository at this point in the history
…r/installed.php
  • Loading branch information
ondrejmirtes committed Feb 16, 2021
1 parent 138f19e commit 6367eb6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Analyser/ResultCache/ResultCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class ResultCacheManager
{

private const CACHE_VERSION = 'v6-installed';
private const CACHE_VERSION = 'v7-installed-php';

private ExportedNodeFetcher $exportedNodeFetcher;

Expand Down Expand Up @@ -610,17 +610,20 @@ private function getComposerLocks(): array
*/
private function getComposerInstalled(): array
{
$hashes = [];
$data = [];
foreach ($this->composerAutoloaderProjectPaths as $autoloadPath) {
$filePath = $autoloadPath . '/vendor/composer/installed.php';
if (!is_file($filePath)) {
continue;
}

$hashes[$filePath] = $this->getFileHash($filePath);
$installed = require $filePath;
unset($installed['root']);

$data[$filePath] = $installed;
}

return $hashes;
return $data;
}

/**
Expand Down

0 comments on commit 6367eb6

Please sign in to comment.