1
0
Fork 0

Ensure stability-flags, platform and platform-dev keys are objects in composer.lock

pull/12114/head
Jordi Boggiano 2024-09-18 15:45:26 +02:00
parent c8838f198e
commit ad6198ad2a
No known key found for this signature in database
2 changed files with 8 additions and 6 deletions

4
composer.lock generated
View File

@ -2381,13 +2381,13 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^7.2.5 || ^8.0"
},
"platform-dev": [],
"platform-dev": {},
"platform-overrides": {
"php": "7.2.5"
},

View File

@ -368,20 +368,22 @@ class Locker
'packages-dev' => null,
'aliases' => $aliases,
'minimum-stability' => $minimumStability,
'stability-flags' => $stabilityFlags,
'stability-flags' => \count($stabilityFlags) > 0 ? $stabilityFlags : new \stdClass,
'prefer-stable' => $preferStable,
'prefer-lowest' => $preferLowest,
];
if (is_array($lock['stability-flags'])) {
ksort($lock['stability-flags']);
}
$lock['packages'] = $this->lockPackages($packages);
if (null !== $devPackages) {
$lock['packages-dev'] = $this->lockPackages($devPackages);
}
$lock['platform'] = $platformReqs;
$lock['platform-dev'] = $platformDevReqs;
$lock['platform'] = \count($platformReqs) > 0 ? $platformReqs : new \stdClass;
$lock['platform-dev'] = \count($platformDevReqs) > 0 ? $platformDevReqs : new \stdClass;
if (\count($platformOverrides) > 0) {
$lock['platform-overrides'] = $platformOverrides;
}