Skip to content

Commit 7c0fdfe

Browse files
committed
Compatibility with Composer v2 installed.json file format
1 parent 87a71c3 commit 7c0fdfe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Reflection/BetterReflection/SourceLocator/ComposerJsonAndInstalledJsonSourceLocatorMaker.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public function create(string $installationPath): ?SourceLocator
5252
$composer = Json::decode($composerJsonContents, Json::FORCE_ARRAY);
5353

5454
$installedJsonContents = FileReader::read($installedJsonPath);
55-
$installed = Json::decode($installedJsonContents, Json::FORCE_ARRAY);
55+
$installedJson = Json::decode($installedJsonContents, Json::FORCE_ARRAY);
56+
$installed = $installedJson['packages'] ?? $installedJson;
5657

5758
$classMapPaths = array_merge(
5859
$this->prefixPaths($this->packageToClassMapPaths($composer), $installationPath . '/'),

0 commit comments

Comments
 (0)