Skip to content

Commit f11c0f0

Browse files
committed
Result cache - invalidate after running composer install
1 parent 30ba6b0 commit f11c0f0

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/Analyser/ResultCache/ResultCacheManager.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class ResultCacheManager
1717
{
1818

19-
private const CACHE_VERSION = 'v5-exportedNodes';
19+
private const CACHE_VERSION = 'v6-installed';
2020

2121
private ExportedNodeFetcher $exportedNodeFetcher;
2222

@@ -552,6 +552,7 @@ private function getMeta(?array $projectConfigArray): array
552552
'projectConfig' => $projectConfigArray,
553553
'analysedPaths' => $this->analysedPaths,
554554
'composerLocks' => $this->getComposerLocks(),
555+
'composerInstalled' => $this->getComposerInstalled(),
555556
'cliAutoloadFile' => $this->cliAutoloadFile,
556557
'phpExtensions' => $extensions,
557558
'stubFiles' => $this->getStubFiles(),
@@ -604,6 +605,24 @@ private function getComposerLocks(): array
604605
return $locks;
605606
}
606607

608+
/**
609+
* @return array<string, string>
610+
*/
611+
private function getComposerInstalled(): array
612+
{
613+
$hashes = [];
614+
foreach ($this->composerAutoloaderProjectPaths as $autoloadPath) {
615+
$filePath = $autoloadPath . '/vendor/composer/installed.php';
616+
if (!is_file($filePath)) {
617+
continue;
618+
}
619+
620+
$hashes[$filePath] = $this->getFileHash($filePath);
621+
}
622+
623+
return $hashes;
624+
}
625+
607626
/**
608627
* @return array<string, string>
609628
*/

0 commit comments

Comments
 (0)