Ensure stability-flags, platform and platform-dev keys are objects in composer.lock
parent
c8838f198e
commit
ad6198ad2a
|
@ -2381,13 +2381,13 @@
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": {},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "^7.2.5 || ^8.0"
|
"php": "^7.2.5 || ^8.0"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": {},
|
||||||
"platform-overrides": {
|
"platform-overrides": {
|
||||||
"php": "7.2.5"
|
"php": "7.2.5"
|
||||||
},
|
},
|
||||||
|
|
|
@ -368,20 +368,22 @@ class Locker
|
||||||
'packages-dev' => null,
|
'packages-dev' => null,
|
||||||
'aliases' => $aliases,
|
'aliases' => $aliases,
|
||||||
'minimum-stability' => $minimumStability,
|
'minimum-stability' => $minimumStability,
|
||||||
'stability-flags' => $stabilityFlags,
|
'stability-flags' => \count($stabilityFlags) > 0 ? $stabilityFlags : new \stdClass,
|
||||||
'prefer-stable' => $preferStable,
|
'prefer-stable' => $preferStable,
|
||||||
'prefer-lowest' => $preferLowest,
|
'prefer-lowest' => $preferLowest,
|
||||||
];
|
];
|
||||||
|
|
||||||
ksort($lock['stability-flags']);
|
if (is_array($lock['stability-flags'])) {
|
||||||
|
ksort($lock['stability-flags']);
|
||||||
|
}
|
||||||
|
|
||||||
$lock['packages'] = $this->lockPackages($packages);
|
$lock['packages'] = $this->lockPackages($packages);
|
||||||
if (null !== $devPackages) {
|
if (null !== $devPackages) {
|
||||||
$lock['packages-dev'] = $this->lockPackages($devPackages);
|
$lock['packages-dev'] = $this->lockPackages($devPackages);
|
||||||
}
|
}
|
||||||
|
|
||||||
$lock['platform'] = $platformReqs;
|
$lock['platform'] = \count($platformReqs) > 0 ? $platformReqs : new \stdClass;
|
||||||
$lock['platform-dev'] = $platformDevReqs;
|
$lock['platform-dev'] = \count($platformDevReqs) > 0 ? $platformDevReqs : new \stdClass;
|
||||||
if (\count($platformOverrides) > 0) {
|
if (\count($platformOverrides) > 0) {
|
||||||
$lock['platform-overrides'] = $platformOverrides;
|
$lock['platform-overrides'] = $platformOverrides;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue